Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/226.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.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
Android FB图形API OAuth 403发布到FB页面墙时出错_Android_Facebook Graph Api - Fatal编程技术网

Android FB图形API OAuth 403发布到FB页面墙时出错

Android FB图形API OAuth 403发布到FB页面墙时出错,android,facebook-graph-api,Android,Facebook Graph Api,因此,我从Graph API收到以下回复: {Response: responseCode: 403, graphObject: null, error: {HttpStatus: 403, errorCode: 200, subErrorCode: -1, errorType: OAuthException, errorMessage: (#200) The permission(s) publish_actions are not available. It has been deprec

因此,我从Graph API收到以下回复:

{Response:  responseCode: 403, graphObject: null, error: {HttpStatus: 403, errorCode: 200, subErrorCode: -1, errorType: OAuthException, errorMessage: (#200) The permission(s) publish_actions are not available. It has been deprecated. If you want to provide a way for your app users to share content to Facebook, we encourage you to use our Sharing products instead.}}
在图形调用之前检查访问令牌perms时,我得到:

[manage_pages, publish_pages, public_profile, pages_show_list, email]
应用程序处于开发模式,我是页面的创建者/管理员。。。令人恼火的是,这在昨天运行得很好,只有在用户注销并重新登录应用程序后才会发生

投寄代码:

    if(!AccessToken.getCurrentAccessToken().getPermissions().contains("manage_pages")){
                                    Log.d("FBToken", "Requesting new token");
                                    DatabaseReference db = FirebaseDatabase.getInstance().getReference().child("users").child(auth.getUid()).child("FBToken");
                                    db.addListenerForSingleValueEvent(new ValueEventListener() {
                                        @Override
                                        public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

                                            Date date = new Date(1764547200);
//TO GENERATE ACCESS PAGE ACCESS TOKEN

                                            AccessToken token = new AccessToken(dataSnapshot.getValue().toString(),AccessToken.getCurrentAccessToken().getApplicationId(),AccessToken.getCurrentAccessToken().getUserId(),Arrays.asList("manage_pages", "publish_pages"),null, AccessTokenSource.FACEBOOK_APPLICATION_SERVICE,
                                                    AccessToken.getCurrentAccessToken().getExpires(),AccessToken.getCurrentAccessToken().getLastRefresh(),date);
                                            AccessToken.setCurrentAccessToken(token);
                                        }

                                        @Override
                                        public void onCancelled(@NonNull DatabaseError databaseError) {

                                        }
                                    });
                                }
                                Log.d("FBToken", AccessToken.getCurrentAccessToken().getPermissions().toString());
                                new GraphRequest(
                                        AccessToken.getCurrentAccessToken(),
                                        graphRequest,
                                        params,
                                        HttpMethod.POST,
                                        new GraphRequest.Callback() {
                                            public void onCompleted(GraphResponse response) {
                                               Log.d("FBPost",response.toString());
                                            }
                                        }
                                ).executeAsync();

我在Graph API令牌调试器中调试了访问令牌,它作为永不过期的页面令牌返回。在“链接”过程中,用户被要求使用权限登录(“管理页面”、“发布页面”),有人知道我在这里可能会出错吗

哪个API调用准确地给出了这个响应?在Log.d(“FBPost”,response.toString())下的“发布代码”区域内;这篇文章也从未发布到FB页面。我不认为API响应在那个地方有什么意义,我希望只有在调用实际的登录功能时才会发生。(但我们不知道你的请求的确切参数是什么。)首先,我会尝试从用户设置中完全删除该应用,然后让他们再次授予权限,看看是否有任何变化。因此,我仍然可以使用相同的访问令牌从FB页面中提取数据(从该页面获取post数据)但在运行HttpMethod.POst时,这似乎是一个问题