Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>When logging in, using:</p> <pre><code>NSArray *permissions = [[NSArray alloc] initWithObjects: @"email", nil]; // Attempt to open the session. If the session is not open, show the user the Facebook login UX [FBSession openActiveSessionWithReadPermissions:permissions allowLoginUI:true completionHandler:^(FBSession *session, FBSessionState status, NSError *error) </code></pre> <p>If your "permissions" array is nil, it only requests the Basic access to the user profile. If you need other permissions, just add the wanted ones on the permissions array. The valid values can be found here: <a href="https://developers.facebook.com/docs/howtos/ios-6/" rel="nofollow">https://developers.facebook.com/docs/howtos/ios-6/</a>, like "email", "user_birthday", "user_location", "user_about_me" etc.</p> <p>Note that when logging in / requesting Read Permissions you CANNOT requests for publishing permissions. That must be performed later, after logging in. You can check if the user already has the requested permission (as the Publish one) and, if he/she has it, publish the content; if not, request it:</p> <pre><code>if ([FBSession.activeSession.permissions indexOfObject:@"publish_actions"] == NSNotFound) { // If the user doesn't have the publishing permission, tries to request it befor sharing [FBSession.activeSession requestNewPublishPermissions:[NSArray arrayWithObject:@"publish_actions"] defaultAudience:FBSessionDefaultAudienceFriends completionHandler:^(FBSession *session, NSError *error) { if (!error) { // Tries to share the content again, assuming we now have the permission (...) } else { // Couldn't get the required Permissions } }]; } else { // If the user already have the permissions, tries to publish the content (...) } </code></pre> <p>More info about publishing content, look up "requestNewPublishPermissions" here: <a href="https://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/publish-open-graph-story/" rel="nofollow">https://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/publish-open-graph-story/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload