I'm using the iOS FBSDK in my app that allows Facebook as a means of logging in. My app will require that the user disclose their age and I would like to use Facebook's login flow to enforce this requirement. However, I'm having trouble setting anything as required (except for public profile, which is required by default). I would like to avoid having to tell the user that they can't use the app until they go into their account settings and turn it on. It's a disruptive user experience and the app truly needs certain permissions to function.
I set the login button's read permissions like this:
self.loginButton.readPermissions = @[@"public_profile", @"email", @"user_photos", @"user_birthday"];
and see this:
Is it all possible to do this? When I look at apps tied to my own Facebook account, I see some (Tinder, Glassdoor, and more) that have required permissions so I assume there must be a way to do it.
It is not possible to mark specific permissions as required when using the Facebook OAuth dialog.
The difference in behavior you are seeing is most likely due to when you installed the apps, and what version of Graph API those apps were using. Graph API 1.0 did not provide the ability for people to revoke specific read permissions, and (I am guessing) when you installed those apps, they were targeting 1.0. With apps that are targeting Graph API 2.0 and higher, people have the ability to revoke specific permissions (except for public_profile), and apps need to be prepared to handle missing permissions.
The settings dialog you see reflects the version of Graph API that was used to install that particular app. Any Facebook App IDs created after April 2014 automatically target the current version (2.x) of Graph API in effect at the time they were created, and pre-existing apps were migrated to 2.x earlier this year. So, going forward, people will always be able to decline permissions other than public_profile when installing an app, but for apps already installed, their settings reflect the version that was in effect when they installed the app.