A Facebook permission is a grant from the user that allows your app to read or write a specific category of their data. You declare the permissions you need inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/facebook/facebook-ios-sdk/llms.txt
Use this file to discover all available pages before exploring further.
LoginConfiguration, and the user approves or declines them in the Facebook login dialog.
Read vs. publish permissions
Facebook permissions fall into two broad categories: Read permissions let your app retrieve information about the user. Examples includepublic_profile, email, and user_friends. You can request read permissions any time during the login flow.
Publish permissions let your app post content on the user’s behalf. Examples include publish_actions and pages_manage_posts. Facebook requires you to go through App Review before your app can use publish permissions for users other than yourself.
The Permission type
The SDK represents permissions with thePermission enum, which is ExpressibleByStringLiteral. You can use either the enum case or the raw string:
Permission exposes a .name string that matches the raw Facebook permission name:
Common permissions
| Permission | Enum case | Description |
|---|---|---|
public_profile | .publicProfile | Name, profile picture, and other public fields |
email | .email | Primary email address |
user_friends | .userFriends | Friends who also use your app |
user_birthday | .userBirthday | Date of birth |
user_location | .userLocation | Current city |
user_photos | .userPhotos | Photos uploaded or tagged |
user_posts | .userPosts | Posts on the user’s timeline |
user_gender | .userGender | Gender |
user_age_range | .userAgeRange | Age range |
user_link | .userLink | Facebook profile URL |
user_hometown | .userHometown | Hometown location |
user_events | .userEvents | Events the user hosts or RSVPs to |
user_videos | .userVideos | Videos uploaded or tagged |
user_likes | .userLikes | Pages and objects the user has liked |
pages_show_list | .pagesShowList | Pages the user manages |
ads_read | .adsRead | Ads Insights API data |
Request permissions in LoginConfiguration
Pass your permissions toLoginConfiguration. The SDK validates that permission strings contain no whitespace:
Check granted and declined permissions in the result
TheLoginResult.success case carries the permissions granted and declined in this specific request:
AccessToken.current:
Check permissions before requesting them
Avoid requesting a permission the user has already granted. CheckAccessToken.current first to minimize unnecessary dialogs:
Best practices
Some permissions require your app to go through Facebook’s App Review process before they are available to users other than app admins and testers. Check the Facebook developer documentation for the review requirements of each permission.