问题
I'm letting Firebase handle login to Facebook in my app, as advised in the Firebase docs:
loginButton.setPermissions("email", "public_profile");
When I call GraphRequest.newMeRequest(), I request the user_link permission as follows:
Bundle parameters = new Bundle();
// Need special permission from Faceook in order to get this data. Apply after we've settled on a new name for the app.
parameters.putString("fields", "id, first_name, last_name, email, gender, birthday, timezone, picture, locale, user_link, age_range");
request.setParameters(parameters);
request.executeAsync();
But when GraphRequest.newMeRequest() completes, it returns a null object. This doesn't happen if I leave out user_link in my permissions request.
回答1:
When I call GraphRequest.newMeRequest(), I request the user_link permission as follows
You are not requesting permissions there, you are requesting fields.
And the field is named link
, not user_link
.
You need to request the permission with loginButton.setPermissions
, and then request the field by its correct name.
来源:https://stackoverflow.com/questions/60614008/when-the-user-link-permission-is-requested-from-facebook-graphrequest-newmerequ