【问题标题】:Android Facebook SDK 3.0 Tutorial: "The post's links must direct to the application's connect or canvas URL"Android Facebook SDK 3.0 教程:“帖子的链接必须指向应用程序的连接或画布 URL”
【发布时间】:2013-03-10 02:03:54
【问题描述】:

我是 Android Facebook SDK 3.0 的新手。我正在尝试在https://developers.facebook.com/docs/howtos/androidsdk/3.0/feed-dialog/ 上关注本教程,了解如何使用提要对话框。我成功地让登录教程工作,但在本教程中,我不断收到这个问题标题中的错误。我将此方法复制到我的 MainFragment 类中:

private void publishFeedDialog() {
Bundle params = new Bundle();
params.putString("name", "Facebook SDK for Android");
params.putString("caption", "Build great social apps and get more installs.");
params.putString("description", "The Facebook SDK for Android makes it easier and faster to develop");           
params.putString("link", "https://developers.facebook.com/android");
params.putString("picture", "https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png");

WebDialog feedDialog = (
    new WebDialog.FeedDialogBuilder(getActivity(),
        Session.getActiveSession(),
        params))
    .setOnCompleteListener(new OnCompleteListener() {

        @Override
        public void onComplete(Bundle values,
            FacebookException error) {
            if (error == null) {
                // When the story is posted, echo the success
                // and the post Id.
                final String postId = values.getString("post_id");
                if (postId != null) {
                    Toast.makeText(getActivity(),
                        "Posted story, id: "+postId,
                        Toast.LENGTH_SHORT).show();
                } else {
                    // User clicked the Cancel button
                    Toast.makeText(getActivity().getApplicationContext(), 
                        "Publish cancelled", 
                        Toast.LENGTH_SHORT).show();
                }
            } else if (error instanceof FacebookOperationCanceledException) {
                // User clicked the "x" button
                Toast.makeText(getActivity().getApplicationContext(), 
                    "Publish cancelled", 
                    Toast.LENGTH_SHORT).show();
            } else {
                // Generic, ex: network error
                Toast.makeText(getActivity().getApplicationContext(), 
                    "Error posting story", 
                    Toast.LENGTH_SHORT).show();
            }
        }

    })
    .build();
feedDialog.show(); }

对于使用 Android Facebook SDK 3.0 的用户,我似乎找不到任何关于此问题的信息。

【问题讨论】:

    标签: android facebook dialog


    【解决方案1】:

    转到您的应用设置,点击“高级”,并确保“Stream post URL security”设置为“Disabled”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-07-16
      • 2013-02-03
      • 1970-01-01
      • 2022-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多