gpt4 book ai didi

ios - 如何在iOS中实现Google和Facebook网址处理?

转载 作者:行者123 更新时间:2023-12-01 18:57:06 26 4
gpt4 key购买 nike

我正在寻求实现Google和Facebook登录功能。它们都具有应该在appDelegate中使用的url处理方法。现在我如何在这里区分这两个请求。

Facebook方法就是这样。

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

// Call FBAppCall's handleOpenURL:sourceApplication to handle Facebook app responses
BOOL wasHandled = [FBAppCall handleOpenURL:url sourceApplication:sourceApplication];

// You can add your app-specific url handling code here if needed

return wasHandled;
}

Google的方法如下所示:
 - (BOOL)application: (UIApplication *)application
openURL: (NSURL *)url
sourceApplication: (NSString *)sourceApplication
annotation: (id)annotation {
return [GPPURLHandler handleURL:url
sourceApplication:sourceApplication
annotation:annotation];
}

最佳答案

只是

 return [GPPURLHandler handleURL:url
sourceApplication:sourceApplication
annotation:annotation] || [FBAppCall handleOpenURL:url sourceApplication:sourceApplication];

关于ios - 如何在iOS中实现Google和Facebook网址处理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25991627/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com