I am not exactly sure what is going wrong. I implemented everything specified by developers.Facebook.com to authenticate Facebook login in my iOS application. Here is what I believe is relevant to the problem:
The application I am making is a tabbed application with a navigation controller.
I get a warning for the following code (provided by Facebook developers page):
- (IBAction)authButtonAction:(id)sender {
AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
// The user has initiated a login, so call the openSession method
// and show the login UX if necessary.
[appDelegate openSessionWithAllowLoginUI:YES];
}
The warning is:
Initializing ‘AppDelegate *’ with an expression of incompatible type ‘id< UIApplicationDelegate>’
When I click the authButton, the Facebook app on my iPhone opens and the appropriate message is presented to the user about granting my application access to post status updates. BUT…the control flow is never given back to my application and the Facebook application is left open. I believe this has to do with the above warning.
Try this: