简体   繁体   English

Appcelerator Titanium Facebook模块共享对话框未显示

[英]Appcelerator Titanium Facebook module share dialog not showing

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. 我正在尝试使用facebook模块的共享对话框的示例代码:链接,名称,描述,标题和图片的变量都已预先设置为适当的字符串。

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. Facebook模块似乎可以正常工作,我们正在使用它登录外部帐户并将其链接到Arrowdb。

UPDATE: It seems that it will give false for getCanPresentShareDialog() so it will try to run the presentWebShareDialog(). 更新:似乎它将为getCanPresentShareDialog()提供false,因此它将尝试运行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". 但是,当我查看Facebook模块的API文档时,此特定方法文档显示:“此方法自5.0.0起已被删除”。

The getCanPresentShareDialog also states "This method has been REMOVED since 5.0.0" in the documentation. getCanPresentShareDialog在文档中还指出“此方法自5.0.0起已被删除”。

Anyone have any clue what to do instead? 任何人都知道该怎么办?

Now they changed the docs so that it is simply to call: 现在他们更改了文档,因此只需调用即可:

presentShareDialog()

And it will handle everything on its own. 并且它将自行处理所有问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM