Description
My app uses 2 permissions, public_profile and email.
I set up them using:
<string-array name="my_facebook_permissions" translatable="false">
<item>public_profile</item>
<item>email</item>
</string-array>
and
<meta-data
android:name="com.parse.ui.ParseLoginActivity.FACEBOOK_LOGIN_PERMISSIONS"
android:resource="@array/my_facebook_permissions" />
I see the native and web dialog properly, asking the user these 2 permissions. I also see in the debugger that those 2 permissions are passed properly to facebook.
This is what I see in the debugger inside FacebookAuthentificationProvider, authenticateAsync, accessToken (it seems right, well, I see contact_email, but it doesn't matter)
But if I continue with the debugging... once in my app, after the login, in onActivityResult, if I call
AccessToken accessToken=AccessToken.getCurrentAccessToken();
I see that that access token doesn't have granted permissions or rejected permissions (they are empty), but if I use GraphRequest I can get the user email with String emailFromFacebook = object.optString("email"); without problems.
It doesn't make any sense that those permission variables have different values in those places.
BTW I'm using ParseUI and facebook sdk version 4.0.1
Apart from that, if I reject the email permission in the login dialog, I see inside FacebookAuthentificationProvider that has been rejected by the user:
However, in my app code, in onActivityResult, I see exactly the same than the other case... just nothing, no granted or declined permissions, so accessToken.getDeclinedPermissions().contains("email") is completely useless and when I try to get the user email like before, I receive null (probably because the app doesn't have permission).
I guess this behavior is not normal. BTW I'm supposing that accesstoken.permissions contains granted permissions and accesToken.declinedPermissions contains declined permissions, is that right?
Thanks in advance.