I am trying the example code for a share dialog using the facebook module: The vars for link, name, description, caption and picture has all been set to appropriate strings beforehand.
if(Alloy.Globals.Facebook.getCanPresentShareDialog()) {
Alloy.Globals.Facebook.presentShareDialog({
link: link,
name: name,
description: description,
caption: caption,
picture: picture
});
}
else {
Alloy.Globals.Facebook.presentWebShareDialog({
link: link,
name: name,
description: description,
caption: caption,
picture: picture
});
}
When this code is executed nothing happens.
I also added a share listener to see if any events are sent, but it is silent...
var fbShareListener = function(e){
if (e.success) {
alert(L("FB_SHARE_SUCCESS"));
Ti.API.info('Share request succeeded.');
}
else {
alert(L("FB_SHARE_FAIL"));
Ti.API.info('Failed to share.');
}
};
Alloy.Globals.Facebook.addEventListener('shareCompleted',fbShareListener);
The Facebook module seems to work otherwise, we are using it to login and linking external accounts to Arrowdb.
UPDATE: It seems that it will give false for getCanPresentShareDialog() so it will try to run the presentWebShareDialog(). But when i look in the API docs for the facebook module this particular method documentation says: "This method has been REMOVED since 5.0.0".
The getCanPresentShareDialog also states "This method has been REMOVED since 5.0.0" in the documentation.
Anyone have any clue what to do instead?
Now they changed the docs so that it is simply to call:
And it will handle everything on its own.