Determine if the Dropbox or Facebook SDK should handle the application delegate call

I need to integrate the latest FB-SDK into my iOS application, and the nightmare starts with the application delegate.

The docs say that implement this in the applicationโ€™s application:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { return [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions]; } - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation ]; } 

But my application is not only for FB, but also Dropbox and YouTube.

So my application:openURL: method looks like this:

 - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; // Facebook if([FBSession.activeSession handleOpenURL:url]){ BOOL result = [FBSession.activeSession handleOpenURL:url]; return result; } // Dropbox if ([[DBSession sharedSession] handleOpenURL:url]) { if ([[DBSession sharedSession] isLinked]) { NSLog(@"App linked successfully!"); } return YES; } // Add whatever other url handling code your app requires here return NO; } 

FBSession does not exist anmyore. So, how do I talk about openURL: challenges openURL: from Facebook and Dropbox?

+5
source share

All Articles