我想通过FacebookSDK 4.0发布自定义故事我的应用程序也经过Facebook批准。但我的问题是当我发布故事作为开发人员/管理员角色然后自定义故事成功发布在Facebook上,但自定义故事发布作为一个简单的用户(谁不是开发人员/管理员)它给出权限错误。像
I/System.out(30594): ResponseCustomStory{Response: responseCode: 500, graphObject: null, error: {HttpStatus: 500, errorCode: 200, errorType: FacebookApiException, errorMessage: Permissions error}}
和AccessToken调试
AccessToken token:ACCESS_TOKEN_REMOVED permissions:[user_friends, public_profile, publish_actions]}
我的代码在这里> 在此之前我已经登录了。
FacebookSdk.sdkInitialize(activity);
AccessToken access_token = AccessToken.getCurrentAccessToken();
System.out.println("access_tokenincompleate" + access_token);
SharedPreferences sp = activity.getSharedPreferences("profile",
Context.MODE_PRIVATE);
String pro_name = sp.getString("profileName", null);
if (access_token != null) {
if (hasPublishPermission()) {
// We can do the action right away.
handlePendingAction();
} else {
// We need to get new permissions, then complete the action when
// we get called back.
LoginManager.getInstance().logInWithPublishPermissions(
activity, Arrays.asList(PERMISSION));
}
}
Bundle params = new Bundle();
if(level == 1){
params.putString("message",pro_name +" has completed " + level
+ "st Level in Sosh");
}else{
params.putString("message",pro_name +" has completed " + level
+ "st Level in Sosh");
}
// params.putString("level", "10");
params.putString("level","http://ses.com/fbobjects/sbc_applink.php");
// http://segs.com/fbobjects/customstory.html
new GraphRequest(access_token, "me/namespace:complete", params,
HttpMethod.POST, new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
System.out.println("ResponseCustomStory" + response);
}
}).executeAsync();
我提交了我的游戏以供审核,并且已获得批准和实时(适用于Publish_action权限)。
如果有人遇到类似问题,请提供帮助。