I was getting "This app is in development mode”
error when trying to auth with FirebaseUI + Facebook. This was solved by making the app "available to the general public". After that I'm getting another error which reads
"The user does not have sufficient rights to view the application. User can not view this application due to developer settings"
and logs
2018-07-20 17:56:30.610332+0700 SamuiPlus[79114:33415252] -canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)" 2018-07-20 17:56:30.610602+0700 SamuiPlus[79114:33415252] Falling back to storing access token in NSUserDefaults because of simulator bug 2018-07-20 17:56:30.612003+0700 SamuiPlus[79114:33415252] -canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)" 2018-07-20 17:56:31.913536+0700 SamuiPlus[79114:33502682] TIC Read Status [12:0x0]: 1:57 2018-07-20 17:56:31.913974+0700 SamuiPlus[79114:33502682] TIC Read Status [12:0x0]: 1:57 2018-07-20 17:56:32.078459+0700 SamuiPlus[79114:33415252] INFO: Reveal Server started (Protocol Version 43). 2018-07-20 17:56:32.084358+0700 SamuiPlus[79114:33415252] Could not successfully update network info during initialization. 2018-07-20 17:56:32.136652+0700 SamuiPlus[79114:33415252] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction 2018-07-20 17:56:32.647304+0700 SamuiPlus[79114:33502692] TIC Read Status [13:0x0]: 1:57 2018-07-20 17:56:32.647397+0700 SamuiPlus[79114:33502692] TIC Read Status [13:0x0]: 1:57
I followed all official instructions on setting up firebase & facebook in my app (info.plist, url types), tried different settings on developers.facebook.com, still don't understand what might cause the issue. On android version of the app login with Facebook works fine.
presenting AuthViewController
func showAuthUI(delegate: FUIAuthDelegate) {
presentModalViewControllerDerivedFrom({ (_) -> UIViewController in
let authUI = FUIAuth.defaultAuthUI()
authUI?.delegate = delegate
let authViewController = authUI!.authViewController()
return authViewController
}, animation: true, completion: nil)
}
FUIAuthDelegate
extension ProfilePresenter: FUIAuthDelegate {
func authUI(_ authUI: FUIAuth, didSignInWith authDataResult: AuthDataResult?, error: Error?){
if let error = error as NSError? {
if let errorMessage = error.userInfo["NSLocalizedDescription"] as? String {
//Show Alert with message provided in 'errorMessage'
print("auth ui didSignInWith authDataResult, error: \(errorMessage)")
} else {
//Show General Alert
print("auth ui didSignInWith authDataResult, general error")
}
} else if let user = authDataResult?.user {
//Logged in
// ...
} else {
// Unknow State
print("auth ui didSignInWith authDataResult, unknown state")
}
}
}
AppDelegate
override init() {
super.init()
FirebaseApp.configure()
let authUI = FUIAuth.defaultAuthUI()
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
let authUI = FUIAuth.defaultAuthUI()
let providers: [FUIAuthProvider] = [
FUIGoogleAuth(),
FUIFacebookAuth(permissions: ["public_profile", "email"]),
FUIPhoneAuth(authUI:FUIAuth.defaultAuthUI()!),
]
authUI?.providers = providers
return true
}
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
let sourceApplication = options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String?
if FUIAuth.defaultAuthUI()?.handleOpen(url, sourceApplication: sourceApplication) ?? false {
return true
}
// other URL handling goes here.
return false
}
Login with other providers works just fine. Thanks in advance for any help.