ios - Facebook result.isCancelled 始终适用于 iOS-8 和 iOS-9 其工作正常
<p><p>Facebook SDK 版本:4.10</p>
<p>我正在使用下面的代码</p>
<pre><code>func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: ?) -> Bool {
// Do what you have to do but at the end, instead of 'return true', put :
return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
}
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
}
func applicationDidBecomeActive(application: UIApplication) {
FBSDKAppEvents.activateApp()
}
</code></pre>
<p>永远是真实的</p>
<pre><code>if result.isCancelled {
NSLog("Cancelled")
}
</code></pre>
<p>注意:<em>仅适用于 iOS-8 的问题(iOS-9 工作正常)</em></p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>我发现它为什么对我来说是坏的。我还使用 Google/SignIn 进行 Google 身份验证。当我将 cocoapods 设置为 <code>pod 'Google/SignIn', '~> 2.0'</code> 时,问题就消失了。问题是 iOS 8 中没有调用 <code>application:openURL:sourceApplication:annotation</code>。请注意,此方法在 iOS 9 中已弃用。</p></p>
<p style="font-size: 20px;">关于ios - Facebook result.isCancelled 始终适用于 iOS-8 和 iOS-9 其工作正常,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/35645769/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/35645769/
</a>
</p>
页:
[1]