TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/thebergamo/react-native-fbsdk-next/llms.txt
Use this file to discover all available pages before exploring further.
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.- A
Profileinstance if a user is logged in nullif no user is logged in
Instance Properties
All properties are read-only and may benull 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.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.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.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.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
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:| Field | Permission Required | Platform |
|---|---|---|
email | email | iOS only |
linkURL | user_link | Both |
friendIDs | user_friends | iOS Limited Login |
birthday | user_birthday | iOS Limited Login |
ageRange | user_age_range | iOS Limited Login |
hometown | user_hometown | iOS Limited Login |
location | user_location | iOS Limited Login |
gender | user_gender | iOS Limited Login |
Platform Differences
iOS
- Full support for all profile fields
- Extended fields available with Limited Login
emailfield populated when permission granted
Android
- Basic fields supported
emailfield not available- Extended fields (birthday, ageRange, etc.) not available
Best Practices
- Check for null values before accessing profile properties
- Request minimal permissions needed for your use case
- Cache profile data appropriately to minimize API calls
- Handle platform differences when accessing iOS-only fields
- Respect user privacy - only request and use data you truly need
Related
- LoginManager - Authenticate users and request permissions
- AccessToken - Manage user access tokens
- Facebook Graph API - Fetch additional user data