gpt4 book ai didi

android - 图谱 API v2.3,无法将读取权限 (read_custom_friendlists) 传递给发布授权请求

转载 作者:太空狗 更新时间:2023-10-29 15:45:42 27 4
gpt4 key购买 nike

我正在尝试在我的 Android 应用程序中添加访问 friend 列表的额外权限,有很多关于旧 API 图的资源,但找不到新 API 的任何内容,所以我尝试向数组添加新权限,但没有成功'无法正常工作,我遇到了以上错误。

public void getProfileInformation()
{
AccessToken token = AccessToken.getCurrentAccessToken();
LoginManager.getInstance().logInWithPublishPermissions(LoginActivity.this, Arrays.asList(new String[]{"email", "publish_actions", "user_birthday", "user_hometown","read_custom_friendlists"}));

final GraphRequest request = GraphRequest.newMeRequest(token, new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(JSONObject object, GraphResponse response) {

try {
Log.d("Firstname", object.getString("id"));
} catch (JSONException e) {
e.printStackTrace();
}
Log.d("Response Friend List", response.toString());

}
});
final Bundle parameters = new Bundle();
parameters.putString("fields", "id, email, picture, birthday");
parameters.putString("user", "100006601683765");

GraphRequestAsyncTask graphRequest = new GraphRequest( AccessToken.getCurrentAccessToken(),"/{user-id}/", null , HttpMethod.GET ,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
parameters.putString("fields", "id, email, picture, birthday");
parameters.putString("user", "100006601683765");
request.setParameters(parameters);
//request.getParameters();
request.executeAsync();

Log.d("Yasser List",request.getGraphPath());
}
}
).executeAsync();
}

最佳答案

Graph API v2.3 , Cannot pass a read permission (read_custom_friendlists) to a request for publish authorization

这个错误意味着你不能在

中传递这些权限

logInWithPublishPermissions

你用过

LoginManager.getInstance().logInWithReadPermissions(instance, Arrays.asList("public_profile","user_friends","email"));

NOT This

LoginManager.getInstance().logInWithPublishPermissions(LoginActivity.this, Arrays.asList(new String[]{"email", "publish_actions", "user_birthday", "user_hometown","read_custom_friendlists"}));

关于android - 图谱 API v2.3,无法将读取权限 (read_custom_friendlists) 传递给发布授权请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30610276/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com