Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/vim/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Me/Feed Facebook Android sdk 3.0_Android_Http Post_Facebook Sdk 3.0 - Fatal编程技术网

Me/Feed Facebook Android sdk 3.0

Me/Feed Facebook Android sdk 3.0,android,http-post,facebook-sdk-3.0,Android,Http Post,Facebook Sdk 3.0,我希望能够从我的android应用程序共享帖子,但我无法实现。我已将facebook sdk 3.0添加到我的应用程序中。我可以得到用户名、userFirstName、userLastName等,但我不能发送提要。 下面是我使用的代码: Bundle postParams = new Bundle(); postParams.putString("name", "Facebook SDK for Android"); postParams.putString("caption", "Build

我希望能够从我的android应用程序共享帖子,但我无法实现。我已将facebook sdk 3.0添加到我的应用程序中。我可以得到用户名、userFirstName、userLastName等,但我不能发送提要。 下面是我使用的代码:

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

Request.Callback callback= new Request.Callback() {
    public void onCompleted(Response response) {
                        Log.e("Sonuc", "Geldi");
    }
};

Request request = new Request(session, "me/feed", postParams, HttpMethod.POST, callback);
RequestAsyncTask task = new RequestAsyncTask(request);
task.execute();
此代码段来自

当我执行这段代码时,它会记录成功完成的情况。我的意思是请求的onComplete方法。回调可以正常工作。。 其他任何内容都不会记录为错误。我不明白为什么它不起作用?这与发布权限有关吗


此代码段有什么问题?

可能您忘记了获得“发布操作”的权限

private boolean isSubsetOf(集合子集,集合超集){
for(字符串:子集){
如果(!superset.contains(string)){
返回false;
}
}
返回true;
}
如果(!isSubsetOf(权限、权限)){
pendingPublishReauthorization=真;
Session.newpermissions请求newpermissions请求=新会话
.NewPermissionsRequest(此,权限);
session.requestNewPublishPermissions(newPermissionsRequest);
返回;
}
private boolean isSubsetOf(Collection<String> subset, Collection<String> superset) {
for (String string : subset) {
    if (!superset.contains(string)) {
        return false;
    }
}
return true;
}

if (!isSubsetOf(PERMISSIONS, permissions)) {
        pendingPublishReauthorization = true;
        Session.NewPermissionsRequest newPermissionsRequest = new Session
                .NewPermissionsRequest(this, PERMISSIONS);
    session.requestNewPublishPermissions(newPermissionsRequest);
        return;
    }