Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting email address by using Facebook SDK 3.0.1 for Android
    primarykey
    data
    text
    <p>I'm currently developing an application which aims to authenticate any user by using Facebook acoount.</p> <p>I have a trouble in getting user email from user's account. My code is below </p> <pre><code> private void signInWithFacebook() { SessionTracker mSessionTracker = new SessionTracker(getBaseContext(), new StatusCallback() { public void call(Session session, SessionState state, Exception exception) { } }, null, false); String applicationId = Utility.getMetadataApplicationId(getBaseContext()); Session mCurrentSession = mSessionTracker.getSession(); if (mCurrentSession == null || mCurrentSession.getState().isClosed()) { mSessionTracker.setSession(null); Session session = new Session.Builder(getBaseContext()).setApplicationId(applicationId).build(); Session.setActiveSession(session); mCurrentSession = session; } if (!mCurrentSession.isOpened()) { Session.OpenRequest openRequest = null; openRequest = new Session.OpenRequest(FacebookLoginActivity.this); if (openRequest != null) { openRequest.setDefaultAudience(SessionDefaultAudience.FRIENDS); openRequest.setPermissions(Arrays.asList("user_birthday", "email", "user_location")); openRequest.setLoginBehavior(SessionLoginBehavior.SSO_WITH_FALLBACK); mCurrentSession.openForRead(openRequest); } }else { Request.executeMeRequestAsync(mCurrentSession, new Request.GraphUserCallback() { public void onCompleted(GraphUser user, Response response) { Log.w("myConsultant", user.getId() + " " + user.getName() + " " + user.getLink() + " "+ response); } }); } } </code></pre> <p>I am using Facebook SDK 3.0.1 for Android. I have set the permissions required by the Facebook Graph Api. In the response xml, there is no such field like email. Facebook Sdk documentations are not good enough and I don't know hot to obtain email address.</p> <p>Your prompt reply will be greatly appreciated.</p> <p>Thanks in advance,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload