How to handle UIApplication handleOpenURL with multiple URL's How to handle UIApplication handleOpenURL with multiple URL's ios ios

How to handle UIApplication handleOpenURL with multiple URL's


Facebook and Instagram both had you setup a custom URL scheme for their services, so we will use that to filter the URL.

-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {    if ([[url scheme] isEqualToString:INSTAGRAM_SCHEME])        return [self.instagram handleOpenURL:url];    if ([[url scheme] isEqualToString:FACEBOOK_SCHEME])        return [PFFacebookUtils handleOpenURL:url];    return NO;}

Where you define your variables as

#define INSTAGRAM_SCHEME @"ig12345678910"#define FACEBOOK_SCHEME  @"fb12345678910"

exactly as you did in your Info.plist file


matomo