1

有人可以发送 REALLY WORK NOW 简单吗?

我接下来使用:

1)在应用程序中进行授权

2)然后按下按钮publishFeedDialog();

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 And0roid makes it easier and faster to develop Facebook integrated Android apps.");
  params.putString("link", "https://developers.facebook.com/android");
 params.putString("picture", "");

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

            @Override
            public void onComplete(Bundle values,
                FacebookException error) {

                Log.e("TAG",values.toString());

                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(activity,
                            "Posted story, id: "+postId,
                            Toast.LENGTH_SHORT).show();
                    } else {
                        // User clicked the Cancel button
                        Toast.makeText(activity.getApplicationContext(), 
                            "Publish cancelled", 
                            Toast.LENGTH_SHORT).show();
                    }
                } else if (error instanceof FacebookOperationCanceledException) {
                    // User clicked the "x" button
                    Toast.makeText(activity.getApplicationContext(), 
                        "Publish cancelled", 
                        Toast.LENGTH_SHORT).show();
                } else {
                    // Generic, ex: network error
                    Toast.makeText(activity.getApplicationContext(), 
                        "Error posting story", 
                        Toast.LENGTH_SHORT).show();
                }
            }



        })
        .setFrom("")
       .setTo(userId)
        .build();
         feedDialog.show();
}

当我发送消息时,我看到我的朋友已从 Id 中识别出来。

我收到类似的东西:

Webview loading URL: https://m.facebook.com/dialog/feed
Redirect URL: fbconnect://success?post_id=1266196038_167455066740536

但是没有出现朋友提要中的消息。没有 .setTo(userId) 的代码像往常一样在提要我的消息时发送给我。

在授权我使用

List<String> permission = new ArrayList<String>();

        permission.add("publish_actions");
        permission.add("publish_stream");

并在清单中写入 app_id。

<meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/app_id" />

请帮帮我!

PS 现在(2013 年 2 月之后)是否可以在 facebook 上发送给朋友的提要?

4

1 回答 1

0

(编辑):这仅适用于通过图形 API。

请查看2013 年 2 月 Breaking Changes Now Live 下的倒​​数第二点。它不再可用。

于 2013-03-06T16:55:02.790 回答