NodeJS getAvatar don't work.
Good afternoon,
I'm trying to get the URL of the Avatar with nodejs (1.41.4). However, contact.avatar provided the unknownContact
avatar: '******/rainbow-node-sdk/lib/resources/unknownContact.png',
and the new function contacts.getAvatarByContactId(id) also return the same value
With WebSDK, I can have the right url :
Best regards.
-
Hello Alejandro,
Could you try with sdk 1.42.3. And did you also provide the second parameter of the getAvatarByContactId ?
/**
* @public
* @method getAvatarByContactId
* @instance
* @param {string} id The contact id
* @param {string} lastAvatarUpdateDate use this field to give the stored date ( could be retrieved with contact.lastAvatarUpdateDate )
* if missing or null in case where no avatar available a local module file is provided instead of URL
* @memberof Contacts
* @description
* Get a contact avatar by his contact id
* @return {String} Contact avatar URL or file
*/
Example :var list = that.rainbowSDK.contacts.getAll();
if (list) {
list.forEach(function (contact) {
that.logger.log("debug", "MAIN - [start ] :: contact : ", contact);
let avatar = that.rainbowSDK.contacts.getAvatarByContactId(contact.id, contact.lastAvatarUpdateDate);
that.logger.log("debug", "MAIN - [start ] :: contact : ", contact, "avatar : ", avatar);
});
} else {
that.logger.log("debug", "MAIN - [start ] :: contacts list empty");
}
Best regards,
Vincent.
Please sign in to leave a comment.
Comments
2 comments