Firebase phone authentication iOS no verificationID

#1

Hello,
I’m implementing Firebase’s phone authentication. It works fine on an Android device, but on an iPhone, the verifyPhoneNumber() function returns credentials but no verification ID. Thus,

window.FirebasePlugin.verifyPhoneNumber(tell, 60, function (credential) {
console.log(credential.verificationId);
})

returns blank/undefined. Like I said, on Android, it does return the ID.
Any idea why? I need the verificationId to proceed. Please help me out!

Thanks!

#2

Hi
Do u fix it now ?

#3

No, still unable to fix it.

#4

I think I fixed it. It turns out that the returned credential IS the verification ID. So instead of

credential.verificationId

just use (for iOS)

credential

You can do a check like so…

if (credential.verificationId)
console.log("Android credential: ", credential.verificationId);
else
console.log("iOS credential: ", credential);

Hope this helps.

#5

Dear obinnae

Thanks a lot,
Can u tell me that , u use which firebase plugin on ionic ?
Thanks very much again

Ivan

#6

Hi Ivan,
I used the generic Firebase plugin cordova-plugin-firebase

Regards