I have tried using below code in loop of dialog. I get the url of photo in getInfo function, but unable to access that url when dialog is rendered. Can anyone please help me to solve this issue.
_.each(dialogs, function (dialog) {
self._cache[dialog._id] =
helpers.compileDialogParams(dialog);
var searchParams = {filter: { field: 'id', param: 'in', value: val }};
QB.users.listUsers(searchParams, function(error, result) {
if(typeof result.items[0].user.blob_id === 'number'){
self._cache[dialog._id]['blob_id'] = result.items[0].user.blob_id;
}
QB.content.getInfo(blob_id, function(error, result) {
if (error) {
done.fail("Get file information by ID error: " + JSON.stringify(error));
}else {
if(result.blob){
var fileUID = result.blob.uid;
var fileUrl = QB.content.privateUrl(fileUID);
self._cache[dialog._id]['fileUrl'] = fileUrl;
}else{
var fileUrl = null;
self._cache[dialog._id]['fileUrl'] = fileUrl;
}
}
});
});
self.renderDialog(self._cache[dialog._id]);
}