android - 无法在 Android 上使用 Cordova 社交共享插件在 Facebook 上共享自定义文本

标签 android cordova sharing social-media

我正在使用 cordova 为 android 和 iphone 构建一个应用程序。我有这个功能可以在 facebook 上分享一些文本:

window.plugins.socialsharing.canShareVia('com.facebook.katana', 'msg', null, null, null,
    function () {
        window.plugins.socialsharing.shareViaFacebook("Some custom text here" + link),
        null,
        null,
        console.log('share ok'), // success callback
        function (errormsg) {
            alert(errormsg);
        }); // error callback
    },
    function () {
        console.log("NO FACEBOOK AVAILABLE");
        navigator.notification.alert('The Facebook app is not available on your device.', // message
        console.log('facebook app not installed'), // callback
        'Share', // title
        'Ok' // buttonName
        );
    });

在 iphone 中一切正常,我可以通过 native 应用程序在 facebook 上分享文本和链接。在 Android 中,Facebook 应用程序将打开,但自定义文本丢失,尽管链接确实出现。

您可以在此处查看生成的帖子:https://www.dropbox.com/s/bo0ughcv9w36zec/Screen_Shot.png

我找到了一些帖子:https://developers.facebook.com/blog/post/510/声明自定义消息将被忽略,但我不确定这是否适用,除了在 ios 中工作正常。任何帮助将不胜感激。谢谢。

最佳答案

Facebook 好像不允许,在他们的facebook app for android 中,添加自定义文本,我们只能分享一个链接。更多信息可以在这里找到:https://developers.facebook.com/bugs/332619626816423

关于android - 无法在 Android 上使用 Cordova 社交共享插件在 Facebook 上共享自定义文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24284977/

相关文章:

java - Android 使用斑马打印机 imz320 打印阿拉伯语显示为反转字符

cordova - 为什么在 android 8 上尝试保存联系人时 ionic-native/contacts 插件会导致应用程序崩溃?

iOS 无法找到插件,Android 正常

cordova - 预填充 Cordova 应用程序文件

file - 在两个本地 Web Ubuntu 服务器之间传输文件的最快方法?

android - install-missing-android-tools@2.1.1(退出代码 : 1) using Bitrise

c# - 请帮助减少 Xamarin.Android apk 大小

css - Angular 2 模块/应用程序结构

android - 删除拇指并为禁用的搜索栏设置 progressTint

iOS 6 像消息一样共享,而不像照片(UIActivityViewController 和 UIDocumentInteractionController)