在Android上使用Titanium打开Facebook Messenger

时间:2017-11-22 17:21:20

标签: titanium appcelerator appcelerator-titanium titanium-alloy

我想在Android上打开Facebook Messenger。

要在iOS上执行此操作,您只需执行以下操作(如此处所述:https://github.com/appcelerator-modules/ti.facebook):

   var fb = require('facebook');
   fb.presentMessengerDialog({
        title: "Appcelerator Titanium rocks!", // The title of the link
        description: "Shared from my Titanium application", // The description of the link
        link: "https://appcelerator.com", // The link you want to share
        referal: "ti_app", // The referal to be added as a suffix to your link
        placeID: "my_id", // The ID for a place to tag with this content
        to: [] // List of IDs for taggable people to tag with this content
    });

你会如何在Android上执行此操作?

1 个答案:

答案 0 :(得分:2)

实际上,Android还没有使用原生Ti.Facebook模块的方法。您可以在此链接 Ti.Facebook 看到它仅适用于 iOS &从 Ti SDK 5.4.0

开始

在David的回答中,他错过了该代码文件的第一行,其中写道:

if (Ti.Platform.osname == "android") {
    Ti.API.warn("This feature is currently iOS-only.");
    return;
}

但您仍然可以尝试使用Intents在Android上打开信使对话框,如此处所述 Android Intents in Titanium

您可以在Google上搜索类似的问题&我希望你能找到很多。以下是 FB Messenger Intent

这样的示例
相关问题