Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handle open multiple URLs in AppDelegate

I have the following code:

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation
{

    return [Braintree handleOpenURL:url sourceApplication:sourceApplication];

}

but Facebook SDK integration requires me to do that:

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation {
  // attempt to extract a token from the url
  return [FBAppCall handleOpenURL:url sourceApplication:sourceApplication];
}

How do I handle opening of the necessary application?

like image 641
Vladimir Stazhilov Avatar asked Jan 19 '15 15:01

Vladimir Stazhilov


1 Answers

Use the response from the method:

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation
{
  if ([FBAppCall handleOpenURL:url sourceApplication:sourceApplication])
    return YES;
  return [Braintree handleOpenURL:url sourceApplication:sourceApplication];
}
like image 189
Ian MacDonald Avatar answered Nov 03 '22 11:11

Ian MacDonald