Firebaseui-ios: Phone Authentication fails only on iPads

Created on 8 Sep 2017  路  11Comments  路  Source: firebase/FirebaseUI-iOS

I'm using FirebaseUI phone authentication as the only method to authenticate my users on both Android and iOS.
It works great on Android (already uploaded my app to google play)
But the iOS version of my app was rejected by Apple, because authentication fails on iPad devices (see attachment).
Important to note that the problem is specific to iPads, and specific to Distribution profile.
The exact same distribution IPA file (which can be downloaded via TestFlight) works OK on iPhones!
The development profile works fine on both iPhone and iPad.

Here are some more details about the iOS app configuration:
Deployment Target: iOS version 10.0
Devices: Universal
build with xCode 8.3.3, using swift.

This is the pod file:

platform :ios, '10.0'

target 'uMov' do

use_frameworks!

pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Messaging'
pod 'Firebase/Storage'
pod 'FirebaseUI/Storage'
pod 'FirebaseUI/Auth'
pod 'FirebaseUI/Phone'
end

This is how I register for remote notifications in AppDelegate:

    let center  = UNUserNotificationCenter.current()
    center.requestAuthorization(options: [.sound,.alert,.badge]) { (granted, error) in
        // Enable or disable features based on authorization
    }
    application.registerForRemoteNotifications()

and this is how I initiate the authentication, using firebase UI:

let authUI = FUIAuth.defaultAuthUI()
let phoneAuth = FUIPhoneAuth(authUI: authUI!)
authUI?.providers = [phoneAuth]
phoneAuth.signIn(withPresenting: self)

Needless to say that APN capabilities are turned on, and the APN auth key was added in the console's cloud messaging.
After all, it works fine on iPhone devices.
I tested on multiple devices, and the problem is consistent.

Did you tackle this issue before?
Any ideas what can be the problem that causes it to fail only on iPads, and not on iPhones devices?

auth bug

Most helpful comment

I see the same error on iPhone, but it works on simulator.
What is "Something went wrong"? What exactly?!
I do not see any additional messages in console.
How does it possible? How can I resolve this problem?

All 11 comments

attachment-screenshot-0906-102942

One more important flow to mention:
1) I'm installing the distribution IPA using TestFlight. It is ok on iPhone, but brings the "something went wrong" error on iPad (see screenshot).
2) I take the same iPad device on which I saw the problem, and I connect it to my MacBook so that I will be able to run my debug version through xCode and get some logs. xCode asks to register this device in my apple account (makes sense). and the applications runs OK under the development profile.
3) This fixes the problem permanently on this device. When I try to reproduce the problem on this same iPad device, I cannot. It is reproduced only on other iPad devices. Meaning: after I uninstalled the dev application, and downloaded again the distribution IPA file from step 1, the authentication works fine.

I see the same error on iPhone, but it works on simulator.
What is "Something went wrong"? What exactly?!
I do not see any additional messages in console.
How does it possible? How can I resolve this problem?

I am facing the same issue. It seems like issue is due to not getting APNS permissions.
I am using:
Swift 2.3.
'FirebaseUI/Phone', '~> 4.0'

@hash3r I assume that you're already using the reCAPTCHA fallback given it works for you on simulator, correct? Is the issue on devices always reproducible? If so, it probably means the your app's APNs setup does not match the configuration on the Firebase Console. Please make sure the iOS app in the Firebase Console (the one you downloaded GoogleService-Info.plist from) declares the same bundle ID as the bundle ID of your app, and the APNs Auth Key or Private Certificates uploaded for that app in the Firebase Console are for this bundle ID. In addition, in case you manually call FIRAuth.setAPNSToken with a token type (sandbox or production), it should match the type of your app (local development or TestFlight/AppStore release).

My problem is solved. I was using 'FirebaseUI/iPhone' 4.2 version. When I updated the version to 4.4. It worked.

I still face this issue with 4.5 :(

+1 in simulator works but not in device.

@morganchen12 You know because this happened?

This issue is there and no clue.

It is really annoying issue.

Anyone find an update to this? I'm on Firebase 4.11.0. It works on the simulator, but not on my iPhone.

Was this page helpful?
0 / 5 - 0 ratings