Skip to main content
The Profile class represents an immutable Facebook user profile with a global currentProfile instance for adding social context to your application.

Import

Static Methods

getCurrentProfile

Retrieves the current logged-in user’s profile.
Returns a Promise that resolves to:
  • A Profile instance if a user is logged in
  • null if no user is logged in
Example:

Instance Properties

All properties are read-only and may be null if not available.

userID

The user’s Facebook ID.

name

The user’s complete name.

firstName

The user’s first name.

lastName

The user’s last name.

middleName

The user’s middle name.

email

The user’s email address.
iOS only. This field is only populated if the user granted the email permission. Not available on Android.

imageURL

URL to the user’s profile image.

linkURL

URL to the user’s Facebook profile.
This field is only populated if the user granted the user_link permission.

refreshDate

The last time the profile data was fetched.

friendIDs

Array of the user’s friend IDs.
iOS Limited Login only. This field is only populated if the user granted the user_friends permission and is using Limited Login on iOS.

birthday

The user’s birthday.
iOS Limited Login only. This field is only populated if the user granted the user_birthday permission and is using Limited Login on iOS.

ageRange

The user’s age range.
iOS Limited Login only. This field is only populated if the user granted the user_age_range permission and is using Limited Login on iOS.
Example:

hometown

The user’s hometown.
iOS Limited Login only. This field is only populated if the user granted the user_hometown permission and is using Limited Login on iOS.
Example:

location

The user’s current location.
iOS Limited Login only. This field is only populated if the user granted the user_location permission and is using Limited Login on iOS.
Example:

gender

The user’s gender.
iOS Limited Login only. This field is only populated if the user granted the user_gender permission and is using Limited Login on iOS.

permissions

Array of permissions the user has granted.

Usage Examples

Display User Profile

Check if User is Logged In

Access Extended Profile Data (iOS Limited Login)

Profile Refresh Tracking

TypeScript Types

ProfileMap

Raw profile data object returned from native modules.

Constructor

Creates a new immutable Profile instance from a ProfileMap. The profile object is frozen and cannot be modified after creation.
You typically don’t need to construct Profile instances manually. Use Profile.getCurrentProfile() instead.

Permissions Required

To access certain profile fields, users must grant specific permissions: Example: Requesting permissions

Platform Differences

iOS

  • Full support for all profile fields
  • Extended fields available with Limited Login
  • email field populated when permission granted

Android

  • Basic fields supported
  • email field not available
  • Extended fields (birthday, ageRange, etc.) not available

Best Practices

  1. Check for null values before accessing profile properties
  2. Request minimal permissions needed for your use case
  3. Cache profile data appropriately to minimize API calls
  4. Handle platform differences when accessing iOS-only fields
  5. Respect user privacy - only request and use data you truly need