问题描述
由于Swift 3-iOS 10,Xcode 8 GM SDK,在使用Facebook SDK进行身份验证的末尾,我收到空白屏幕.它曾经工作过.我在AppDelegate中有一些警告:
Since Swift 3 - iOS 10, Xcode 8 GM SDK, I receive blank white screen at the end of the authentication with Facebook SDK.It worked before. I have some warnings in the AppDelegate:
也许与它有关.
我了解这些功能已被弃用,我尝试将其更改为新功能,但FBSDKApplicationDelegate仍要求使用较早的参数...
I understood these functions are deprecated, and I tried changing these to the new functions, but the FBSDKApplicationDelegate still requests the older parameters...
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
}
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(app, open: url, sourceApplication: <#T##String!#>, annotation: <#T##Any!#>)
}
如您所见,问题出在第二个功能上.
As you see, the problem is now with the second function.
推荐答案
我了解这些功能在iOS 9中已弃用,因此我将其他功能与自己的API结合使用.
I understand these functions are deprecated in iOS 9, so that I used the others functions with their own API.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
}
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(app, open: url, sourceApplication: options[UIApplicationOpenURLOptionsKey
.sourceApplication] as! String!, annotation: options[UIApplicationOpenURLOptionsKey.annotation])
}
这篇关于Facebook身份验证-身份验证期间白屏空白-iOS 10 GM,Swift 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!