Android - 呈现Facebook Messenger应用程序会导致崩溃

时间:2014-06-05 14:54:45

标签: android facebook facebook-android-sdk

我正在尝试与Android上的新Facebook Messenger对话框分享链接。我使用新的Facebook SDK 3.14.1。

当我加载要呈现Facebook对话框的片段时,我会直接从文档中获取:https://developers.facebook.com/docs/android/share#message-dialog

我的片段onActivityCreated

    // Check if the Facebook app is installed and we can present the share dialog
    FacebookDialog.MessageDialogBuilder builder = new FacebookDialog.MessageDialogBuilder(getActivity())
        .setLink("https://developers.facebook.com/docs/android/share/")
        .setName("Message Dialog Tutorial")
        .setCaption("Build great social apps that engage your friends.")
        .setPicture("http://i.imgur.com/g3Qc1HN.png")
        .setDescription("Allow your users to message links from your app using the Android SDK.")
        .setFragment(this);

    // If the Facebook app is installed and we can present the share dialog
    if (builder.canPresent()) {
      // Enable button or other UI to initiate launch of the Message Dialog
        Log.i("","FACEBOOK MESSENGER IS INSTALLED");
        FacebookDialog dialog = builder.build();
        dialog.present();
    }  else {
      // Disable button or other UI for Message Dialog 
        Log.i("","FACEBOOK MESSENGER IS NOT INSTALLED");
    }

检查工作正常,我收到日志消息"安装了FACEBOOK MESSENGER" (它是)。但是,当我尝试呈现对话时,我得到了错误:

Error

有谁知道这可能是什么?我试过多个设备。有没有人成功地做到了这一点?

由于

0 个答案:

没有答案