3

i'm adding Facebook signup in my application, i got this issue

-canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)" Falling back to storing access token in NSUserDefaults because of simulator bug

this is my appDelegate

import UIKit
import FBSDKCoreKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


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

        UIApplication.shared.statusBarStyle = .lightContent

        UINavigationBar.appearance().barTintColor = UIColor(red: 0.19, green: 0.18, blue: 0.31, alpha: 1.0)
        UINavigationBar.appearance().tintColor = UIColor.white
        UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.white]


        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: nil
        )
    }

    func applicationWillResignActive(_ application: UIApplication) {

    }

    func applicationDidEnterBackground(_ application: UIApplication) {

    }

    func applicationWillEnterForeground(_ application: UIApplication) {

    }

    func applicationDidBecomeActive(_ application: UIApplication) {

        FBSDKAppEvents.activateApp()
    }

    func applicationWillTerminate(_ application: UIApplication) {
    }
}

and this is my info.plsit

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb1835000000000000</string>
            </array>
        </dict>
    </array>
    <key>FacebookAppID</key>
    <string>1835000000000000</string>
    <key>FacebookDisplayName</key>
    <string>FoodTasker</string>
    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>fbapi</string>
        <string>fb-messenger-share-api</string>
        <string>fbauth2</string>
        <string>fbshareextension</string>
    </array>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
</dict>
</plist>
  • SDK v4.34.0
  • iOS SDK 10.2
James Z
  • 12,209
  • 10
  • 24
  • 44
Saad Tlh
  • 179
  • 3
  • 13
  • Possible duplicate of [How to use Facebook iOS SDK on iOS 10](https://stackoverflow.com/questions/38689631/how-to-use-facebook-ios-sdk-on-ios-10) ... found via a google search for `"OSStatus error -10814"` – DonMag Sep 05 '18 at 18:26
  • thanks for reply. i check the link you have post it says : "It happens because Apple changed the way of working with keychain in iOS 10. To fix this issue you simply should go to Targets->Capabilities and enable keychain sharing (it enables access to keychain for your app)" i did that but still not working – Saad Tlh Sep 05 '18 at 19:20
  • Are you running this on the Simulator or on a Device? – DonMag Sep 05 '18 at 19:52
  • I'm using Simulator – Saad Tlh Sep 05 '18 at 21:04
  • 1
    Quick searching seems to indicate it won't work on Simulator, because FB is not installed. Do a google search for `"fbauth2" "OSStatus error -10814" "simulator"` ... lots of results... you should be able to either find a solution or confirm it won't work on simulator. – DonMag Sep 05 '18 at 21:09
  • sure i Will do thank you – Saad Tlh Sep 05 '18 at 22:34

1 Answers1

2

now I used the latest pod version and I have followed below steps 1) Add comment code in pod file like below code

pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'

2) Open terminal and go in Project directory then run followed command

pod install
above code will removed Facebook SDK from project

3) Uncomment 1 step code then reinstall facebook library. It will install latest veriosn facebook SDK and try to run again. Issue will solved :)

Thank you

Praful Argiddi
  • 1,152
  • 1
  • 8
  • 12