Facebook SDK 版本:4.10
我正在使用下面的代码
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> 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()
}
永远是真实的
if result.isCancelled {
NSLog("Cancelled")
}
注意:仅适用于 iOS-8 的问题(iOS-9 工作正常)
我发现它为什么对我来说是坏的。我还使用 Google/SignIn 进行 Google 身份验证。当我将 cocoapods 设置为 pod 'Google/SignIn', '~> 2.0'
时,问题就消失了。问题是 iOS 8 中没有调用 applicationpenURL:sourceApplication:annotation
。请注意,此方法在 iOS 9 中已弃用。
关于ios - Facebook result.isCancelled 始终适用于 iOS-8 和 iOS-9 其工作正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35645769/
欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) | Powered by Discuz! X3.4 |