处理AppDelegate中的多个URL

时间:2015-01-19 15:38:50

标签: ios appdelegate facebook-sdk-3.0

我有以下代码:

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

    return [Braintree handleOpenURL:url sourceApplication:sourceApplication];

}

但Facebook SDK集成要求我这样做:

- (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];
}

如何处理必要的申请?

1 个答案:

答案 0 :(得分:5)

使用方法的响应:

- (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];
}