FBSDK Login Error Code: 308 in Objective-C

Jude Michael Murphy picture Jude Michael Murphy · Jun 6, 2015 · Viewed 37.3k times · Source

I keep getting

"Error Domain=com.facebook.sdk.login Code=308 "The operation couldn’t be completed. (com.facebook.sdk.login error 308.)""

upon trying to login with Facebook from my device.

My code works on the simulator, but not on an actual device. Has anyone ran into this error code before? I'll be more than happy to share code upon request.

Answer

Suraj Pathak picture Suraj Pathak · Aug 10, 2016

The solution below works for iOS9 + running on Xcode 8, for Swift3.0

The steps are

  1. Setup Facebook Launch

FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)

  1. Setup Open Url

    guard let source = options[UIApplicationOpenURLOptionsSourceApplicationKey] as? String else { return false } let annotation = options[UIApplicationOpenURLOptionsAnnotationKey] as? String return FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: source, annotation: annotation)

  2. Fix Keychain permission issue as shown in the image below

iOS 9 Keychain fix