Facebook身份验证 - 身份验证期间出现空白屏幕 - iOS 10 GM,Swift 3

时间:2016-09-11 15:33:18

标签: ios swift facebook authentication

自Swift 3 - iOS 10,Xcode 8 GM SDK以来,我在使用Facebook SDK进行身份验证结束时收到空白屏幕。 以前工作过。我在AppDelegate中有一些警告:

enter image description here

也许它与它有关。

编辑: 我知道这些函数已被弃用,我尝试将这些函数更改为新函数,但FBSDKApplicationDelegate仍然请求旧参数...

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!#>)
}

如您所见,现在问题出现在第二个功能上。

2 个答案:

答案 0 :(得分:2)

试试这个!

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])
}

答案 1 :(得分:0)

我了解这些功能在iOS 9中已弃用,因此我将其他功能与自己的API一起使用。

df1 <- structure(list(test = c("test1", "test1", "test2", "test2", "test3"
), tester = c(1L, 2L, 1L, 2L, 2L), obs1 = c("Y", "Y", "Y", "Y", 
"N"), obs2 = c("Y", "N", "Y", "Y", "N")), .Names = c("test", 
"tester", "obs1", "obs2"), class = "data.frame", row.names = c(NA, 
-5L))