I've done something similar in the past.
It was a flow where any user holding the iPad logs in with his or hers FB credentials, forcing the sdk to present a webview.
A quick look, this is the code I wrote for it:
(this code is 1.5y old)
FBSession *newSession = [[FBSession alloc] initWithPermissions:@[
@"user_about_me",
@"publish_actions",
@"user_birthday",
@"friends_birthday",
@"email"
]];
[FBSession setActiveSession:newSession];
[[FBSession activeSession] openWithBehavior:FBSessionLoginBehaviorForcingWebView completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
[FBSession setActiveSession:session];
if(error){
NSLog(@"Error opening session");
[self showLoginError:error];
return;
}
if(status == FBSessionStateOpen){
NSLog(@"FB session opened");
[self getMe];
}
}];
When the flow ends, or the user cancels the flow, I logs the user out as follows:
[[FBSession activeSession] closeAndClearTokenInformation];
[FBSession setActiveSession:nil];
UPDATE:
The code for the share dialog:
NSMutableDictionary *dialogParameters = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[NSString stringWithFormat:@"%@ - Vote for us!",
teamName, @"name",
@"Campaign title", @"caption",
shareMessage, @"description",
shareTeamPageURL, @"link",
sharePictureURL, @"picture", nil];
[FBWebDialogs presentFeedDialogModallyWithSession:[FBSession activeSession]
parameters:dialogParameters
handler:nil];