public_profileemailgaming_profilegaming_user_pictureuser_age_rangeuser_birthdayuser_friendsuser_genderuser_hometownuser_linkuser_locationuser_messenger_contactLoginWithTrackingPreference function to specify that the LoginTracking preference is LIMITED for a given login request. Additionally, developers can include an optional nonce meant to verify the response from the Unity SDK. For more information on validating the OIDC token, see Validating the Limited Login OIDC Token.FB.Mobile.LoginWithTrackingPreference(LoginTracking.LIMITED, scopes, "nonce123", this.HandleResult);
AuthenticationToken from the Unity SDK. To retrieve the user’s basic profile information, developers can request the Profile object using the CurrentProfile function - which reads the associated AuthenticationToken.private void GetProfileInfo()
{
var profile = FB.Mobile.CurrentProfile();
if(profile != null) {
this.userName = profile.Name;
this.userId = profile.UserID
this.userEmail = profile.Email;
this.profileImageUrl = profile.ImageURL;
this.userBirthday = profile.Birthday;
this.userAgeRange = profile.AgeRange;
this.userFriendIDs = profile.FriendIDs;
this.userGender = profile.Gender;
this.userLink = profile.LinkURL;
this.userHometown = profile.Hometown;
this.userLocation = profile.Location;
}
}
| Name | Description |
|---|---|
LoginTracking | Enum value indicating if the Login request should have tracking enabled. The values available are ENABLED and LIMITED. |
AuthenticationToken | Helper class containing the authentication token string granted to your application by the current user. This token includes data for the user’s ID, name, profile picture, and email (if granted by the user). |
Profile | Helper class used to retrieve the basic profile information from the current user’s AuthenticationToken. |
| Name | Description |
|---|---|
FB.Mobile.LoginWithTrackingPreference | Prompt a user to authorize your app with requested permissions based on their selected tracking preference. |
FB.Mobile.CurrentAuthenticationToken | Returns the AuthenticationToken granted to your application by the current user. |
FB.Mobile.CurrentProfile | Returns the basic profile information granted to your application by the current user. |
FB.Mobile.LoginWithTrackingPreferenceLoginTracking - Enum selecting between ENABLED and LIMITEDScopes - Permissions for this requestNonce - Optional string used to verify responseIResult) - Callback function that will process the login responseFB.Mobile.CurrentAuthenticationTokenFB.Mobile.CurrentProfilenonce matches the nonce you provided.