Facebook integration in my app works well. I ask for *read_stream* permission at login, then for *publish_actions* when I want to publish anything for the first time (as recommended).
The issue is, that when I ask for *publish_actions* permission, app switches to Facebook app and back. I wouldn't like user to see Facebook app, and I know many apps that post to the wall silently.
How can I do this?
You should ask for publish permission on login, not when publish something for the first time. Once the user is logged in with all needed permission, he won't see the fb app screen again (unless the session expired or is closed).
[FBSession openActiveSessionWithPublishPermissions:@[@"publish_actions"]
defaultAudience:FBSessionDefaultAudienceFriends
allowLoginUI:YES
completionHandler:aCompletionHandler];