简体   繁体   中英

-canOpenURL: failed for URL: “fbauth2:/” - error: “The operation couldn’t be completed. (OSStatus error -10814.)” SWIFT 5 FBDSKCoreKit 5

I have seen a few similar threads and possible solutions, but they are all 1+ yrs old and I dont think relevant to updated versions.

I'm using swift 5, and FirebaseUI 8.4.2 which is compatible with FBSDKLoginKit (~> 5.0). (also using ios 12.2)

My info.plist includes fbauth2 and I've included App Transport Security Settings --> allow arbitrary loads = YES which was added for ios 9.

In my appDelegate I have

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.

    FirebaseApp.configure()
    let db = Firestore.firestore()

    //facebook login
    //ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)

    FBSDKCoreKit.ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)

  return true
   }

  func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
      let handled = ApplicationDelegate.shared.application(app, open: url, options: options)

      return handled
  }

Feel like ive exhausted all solutions in other threads so if anyone has an updated workaround pls could you post below.

After clicking login button receive this message:

在此处输入图像描述

Did you add the correct url scheme for fb in URL Types section in XCode project -> Info tab.

Xcode project Info tab

You can verify that by checking url.scheme in application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM