如何在没有Android应用程序对话框的Facebook墙上发布?

时间:2013-11-25 18:05:35

标签: android facebook facebook-graph-api facebook-android-sdk

现在我正在开发一些包含引号的应用程序,我希望能够在我的Facebook墙上分享任何引用

我正在使用sdk 3,我可以登录,但我无法在没有对话的情况下发布在墙上?

这是我的帖子功能: -

private void PublishToFeedInBackground() {

    final Bundle _postParameter = new Bundle();
    _postParameter.putString("name", "ahmed");
    _postParameter.putString("link", "eew");
    _postParameter.putString("picture", "ew");
    _postParameter.putString("caption", "we");
    _postParameter.putString("message", "efwefwefwe");
    _postParameter.putString("description", "few");


    final List<String> PERMISSIONS = Arrays.asList("publish_stream");

    if (Session.getActiveSession() != null) {
        NewPermissionsRequest reauthRequest = new Session.NewPermissionsRequest(this, PERMISSIONS);
        Session.getActiveSession().requestNewPublishPermissions(reauthRequest);
    }

    this.runOnUiThread(new Runnable() {
        @Override
        public void run() {
            Request request = new Request(Session.getActiveSession(), "me/feed", _postParameter, HttpMethod.POST);

            RequestAsyncTask task = new RequestAsyncTask(request);
            task.execute();
        }
    });
}

1 个答案:

答案 0 :(得分:0)

试试这个 -

[FBRequestConnection startWithGraphPath:@"feed" parameters:fbArguments HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {}];

Reference