android-fb-sdk email is always null -
I have a big problem with Android-Facebook-SDK 3.19.1. There is no problem obtaining public information about the user, but it is not possible to get this email address.
I know that my post is very close to the following thread ==> But I have no solution now.
Then my code is
My connection activity. I have a button R.F.B.B. connected in Java
Private list & lt; String & gt; Permission = arrays.asList ("email"); @ (RDFB_connect) protected void fbConnect () {Ensure open session (); } Confirm Private Boolean Open Session () {session session = session. Gate active session (); If (session == zero ||! Session.ioopid ()) {LOGD (tag, "call session. Open activation"); Session Open Activation (this, true, permissions, new FB-callback ()); return false; } Back true; } The public class applies the FbCallback session. Status Callback {@ Override Public Zero Call (Session Session, Session Session, Status Exception E) / / / Request for API Request. New Mei request (session, new request. GraphUserCallback () {// After the Graph API response with callback user object, override public zero (Graph User User, Response Response) (if (user! = Null) {// User.appMap (). Get ("email") Toast.Make Text (Connection Activity.This, "Email:" + user.getProperty ("Email"), Toast .LENGTH_LONG) .show ();}}}) ExecuteAsync ();}}
I tried the code in the link above but it does not work With this code, I can see the activity of Facebook, which will "get the following information to XXX: your public profile and email address", but toast "email: empty"
Edit
I work with Android studio and my grade file contains the following line
comp.mail.facebook.android:facebook-android-sdk : 3.19.1 '
EDIT2
If I
LOGD (TAG, "Prompt Gatent:" + session .isPermissionGranted (permissions.get 0)));
Before the call Request.newMeRequest
is shown as correct. Permission granted properly
Thx
Comments
Post a Comment