I have a viewcontroller that has code to implement the Facebook window. the problem is that to run the code, I need this url:
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
// attempt to extract a token from the url
self.openedURL = url;
// attempt to extract a token from the url
return [FBSession.activeSession handleOpenURL:url];
}
…and as I have understood it can only be run in the app delegate, but I need it to get the url. If I simply add it to the delegate it is not called, and I don’t know when it is called and how. any suggestions??
If you need to use a property of the app delegate in another class you can use the following code (assuming the the name of your app delegate class is AppDelegate) in your view controller class:
I’m assuming here, that you want to pass this URL along to your controller. You also need to import the AppDelegate.h file into your controller.