Firebase phone authentication iOS no verificationID

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!

Hi
Do u fix it now ?

No, still unable to fix it.

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.

Dear obinnae

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

Ivan

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

Regards