0

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:

enter image description here

maybe it has something to do with it.

Edit: 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.

liquide
  • 1,346
  • 3
  • 20
  • 28
Etgar
  • 5,774
  • 2
  • 16
  • 30

2 Answers2

2

Try this!

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])
}
Barrett
  • 323
  • 5
  • 11
0

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])
}
Etgar
  • 5,774
  • 2
  • 16
  • 30