I'm working through the Facebook API for my iPhone app, and have two questions:
All documentation/examples seem to put everything in the appDelegate: instantiating the Facebook object and authorizing in appDidFinishLaunching, and overriding the application:handleOpenURL method.
In my app, I don't want anything to happen unless a user navigates to a specific view and presses a button. I understand that in that view, I'll instantiate the Facebook object and start the authorization in the button handler method, but what about handling the overriding of application:handleOpenURL? I'd have to use a different FB object (instantiated in my app delegate) than the one used in my particular view controller.
Does this situation call for a singleton? Or is it a good design solution to let my appDelegate instantiate the FB object, and access it through there wherever else I need it in my program?
In the FB docs, they tell you to override the application:handleOpenURL method:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
return [facebook handleOpenURL:url];
}
- As written, doesn't this mean your application will only be able to open one type of url? If you're app needed to respond to more than just one, you'd need to parse the url parameter to figure out which action to take, correct?
Thanks!