I have a Facebook SSO working perfectly on my app, using last release of Facebook Objective-C SDK. I need to ask an extra permission inside the app if user do "something". I don't need to ask that permission if user gave it to me before, so, I guess, in Facebook SDK there should be a method
-(BOOL) checkPermission:(NSString*) permission;
so I can use it like this:
if( [facebook checkPermission:@"email"] ) {
Is there a way to do this?
This question is a bit old but you can now check what permissions the active session has without making a graph request. Here is how it's done in the HelloFacebookSample :
if ([FBSession.activeSession.permissions indexOfObject:@"publish_actions"] == NSNotFound) {
// permission does not exist
} else {
// permission exists
}
Just replace "publish_actions" with "email".
SDK not providing direct method for checking specific permissions but you can check if user granted permission to your application by checking permissions
connection of user
object in Graph API
GET https://graph.facebook.com/me/permissions
Same can be achieved with FQL query on permissions
table
SELECT email FROM permissions WHERE uid = me()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With