I work through the Facebook API for my iPhone application and have two questions:
All documents / examples seem to put everything in appDelegate: creating a Facebook object and authorizing in appDidFinishLaunching and overriding the application: handleOpenURL method.
In my application, I do not want something to happen if the user does not switch to a specific view and presses a button. I understand that from this point of view I will create an instance of the Facebook object and begin authorization in the button handler method, but what about handling the application override: handleOpenURL? I would have to use a different FB object (an instance in my application delta) than the one used in my particular view controller.
Does this situation mean a singleton? Or is it a good design solution that allows my appDelegate to instantiate an FB object and access it wherever I need it in my program?
In the FB docs, they tell you to override the application: the handleOpenURL method:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { return [facebook handleOpenURL:url]; }
- As written, doesn't that mean that your application can only open one type of URL? If you need an application to answer no more than one, you need to analyze the url parameter to find out what action you need to take, fix it?
Thanks!
ios facebook facebook-graph-api facebook-ios-sdk
djibouti33
source share