我想使用自定义网址方案以及Facebook登录,但它不起作用:
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool
但Facebook期望返回值为
FBSDKApplicationDelegate.sharedInstance().application(_:application, open: url, sourceApplication: sourceApplication, annotation:annotation)
因此,在使用新的openUrl
方法时,我无法填写必要的参数。有谁知道如何解决这个问题?
答案 0 :(得分:0)
您应该使用FBSDKApplicationDelegate.application(_: open: options:)
代替。
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
if FBSDKApplicationDelegate.sharedInstance().application(app, open: url, options: options) {
return FBSDKApplicationDelegate.sharedInstance().application(app, open: url, options: options)
} else {
//fallback if FBSDKApplicationDelegate cannot open URL
}
}