I'm trying to add additional permission to access friends list in my Android App , there are many resources about old API graph but could not find anything for new API , so I tried to add new permission to array but it didn't work and I got above error.
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();
}