firebaseAuth via phonenumber - "token mismatch" error on iPhone

Dear Corona community,

I use Scott’s firebaseAuth plugin and can get it to work on my Android device when using SMS-verification. On my iPhone though, I get an “token mismatch” error when sending my phone number. That’s all it says, “token mismatch”.

I have contacted Scott with no luck. I posted this problem in community plugins sections with no luck. I have recreated all my certificates, profiles and keys in apple developer portal over and over again and have excessively worked through the first four google result pages on all sorts of “firebase token mismatch” searches. And still: I’m stuck and I havent achieved any results in days now. If there is anyone out there who knows what exactly this error means and how I can solve it, that would be awesome.

  • I am running in dev mode and of course have added my APN key to firebase console.

  • I have only one bundleID, so there shouldnt be any confusion

  • The only “token mismatch” error according to google firebase docs can occur in “signInWithCustomToken”, where it says: “Indicates the service account and the API key belong to different projects.”

I really need to get this sort out. If there is anyone who knows what to do and guide me via skype / teamviewer, I am willing to pay 100$ via paypal in case of success.

in desperate need of support,

Chris

 

Problem solved!

So, it finally works. I have PMed with user hraza back and forth and double … wait … triple-checked all my settings in Apple developer portal and firebase without success. Last night he told me to go from developer to distribution provisioning and give that a try. I did, without success. After staring at the “token mismatch” error for five minutes in pure frustration mood, I tapped again on my registerbutton and boom, I received the verification SMS (without reloading the app).

I figured that the APNSToken might have been set too late as it needed a second tap on my button to make it work. So I reinstalled the app, tried again and this time it worked right away.

As I found out later, firebaseAuth.isSignedIn() returns true even if the app is de- and reinstalled. So I included a firebaseAuth.SignOut() to make sure the whole process starts from scratch: Registration still worked like a charme.

So, I dont know what exactly changed, but I figured it must at least have something to do with development and distribution mode.

To verify this, I just revoked all my production-certificates and keys and created new dev-certificates and keys. My “hope” was that this would cause the “token mismatch” error again and one could identify the dev-mode as the problem.

But now it works, even in dev-mode.

So, at this moment it feels a little unsafe since I cannot really identify what caused the error. But the most important thing: It works :slight_smile:

Sidenote: Last night I could not build the app in like 3 of 4 attempts, but got a plugin error instead, saying that the notification plugin cannot be included. Dont know if that has something to do with my case, but maybe Corona devs changed something?

Anyway, this can be considered as solved.

Thanks to anybody who took his time to read this.

Please continue any conversation here:  https://forums.coronalabs.com/topic/73643-firebaseauth-via-phonenumber-token-mismatch-error-on-iphone/

Thanks

 

Problem solved!

So, it finally works. I have PMed with user hraza back and forth and double … wait … triple-checked all my settings in Apple developer portal and firebase without success. Last night he told me to go from developer to distribution provisioning and give that a try. I did, without success. After staring at the “token mismatch” error for five minutes in pure frustration mood, I tapped again on my registerbutton and boom, I received the verification SMS (without reloading the app).

I figured that the APNSToken might have been set too late as it needed a second tap on my button to make it work. So I reinstalled the app, tried again and this time it worked right away.

As I found out later, firebaseAuth.isSignedIn() returns true even if the app is de- and reinstalled. So I included a firebaseAuth.SignOut() to make sure the whole process starts from scratch: Registration still worked like a charme.

So, I dont know what exactly changed, but I figured it must at least have something to do with development and distribution mode.

To verify this, I just revoked all my production-certificates and keys and created new dev-certificates and keys. My “hope” was that this would cause the “token mismatch” error again and one could identify the dev-mode as the problem.

But now it works, even in dev-mode.

So, at this moment it feels a little unsafe since I cannot really identify what caused the error. But the most important thing: It works :slight_smile:

Sidenote: Last night I could not build the app in like 3 of 4 attempts, but got a plugin error instead, saying that the notification plugin cannot be included. Dont know if that has something to do with my case, but maybe Corona devs changed something?

Anyway, this can be considered as solved.

Thanks to anybody who took his time to read this.

Please continue any conversation here:  https://forums.coronalabs.com/topic/73643-firebaseauth-via-phonenumber-token-mismatch-error-on-iphone/

Thanks