Skip to content

Getting UserProfile

vineetmobile edited this page Sep 18, 2013 · 3 revisions

SocialAuth Android lets you you get user profile after authentication. All the providers support this functionality.

Profile

###Implementation

private final class ResponseListener implements DialogListener 
{
   public void onComplete(Bundle values) {
   
      adapter.getUserProfileAsync(new ProfileDataListener());			
   }
}

// To receive the profile response after authentication
private final class ProfileDataListener implements SocialAuthListener<Profile> {

@Override
public void onExecute(Profile t) {

   Log.d("Custom-UI", "Receiving Data");
   Profile profileMap = t;
   Log.d("Custom-UI",  "Validate ID         = " + profileMap.getValidatedId());
   Log.d("Custom-UI",  "First Name          = " + profileMap.getFirstName());
   Log.d("Custom-UI",  "Last Name           = " + profileMap.getLastName());
   Log.d("Custom-UI",  "Email               = " + profileMap.getEmail());
   Log.d("Custom-UI",  "Gender  	         = " + profileMap.getGender());
   Log.d("Custom-UI",  "Country  	         = " + profileMap.getCountry());
   Log.d("Custom-UI",  "Language  	         = " + profileMap.getLanguage());
   Log.d("Custom-UI",  "Location 	         = " + profileMap.getLocation());
   Log.d("Custom-UI",  "Profile Image URL  = " + profileMap.getProfileImageURL());
}

Please note different providers support different fields. Here is the list :

  • Facebook : FullName , FirstName , LastName , Email , Location , Gender , Language , Country
  • Twitter : Display Name , FullName, Language
  • MySpace : Display Name , FirstName , LastName, Location, Language
  • Linkedin : Display Name , FirstName , LastName , Email, Location
  • FourSquare : Display Name , FirstName , LastName, Email, Location , Gender
  • SalesForce : Display Name , FirstName , LastName, Email, Language, Country
  • Yahoo : Display Name , FirstName , LastName, Email, Location, Gender, Language
  • Google : Display Name , FirstName , LastName, Email, Language, Country
  • Yammer : FullName, Email, Location
  • RunKeeper : FullName , FirstName, Location, Gender
Clone this wiki locally