react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

firebase phone auth Error: auth/invalid-app-credential Invalid token.

Open chellongCoder opened this issue 6 years ago • 17 comments

I resolved this issue. I create Apple Development IO Push Services and Apple Push Services. image

download both certificate. export them to .p12 and add to firebase console. NOT add file .p8 image hope that help to you.

chellongCoder avatar Feb 08 '20 04:02 chellongCoder

@chellongCoder Thank you for providing a resolution to your problem.

russellwheatley avatar Feb 10 '20 08:02 russellwheatley

I follow your but seem like not working at all. My app is on TestFlight, after download it error auth/invalid-app-credential

lyseiha avatar May 09 '20 13:05 lyseiha

Put simply, you should configure your ios react native app on the apple developer account with the certificate, provisioning profile attached with your bundle ID. Import this into your xcode or enable auto import in the xcode. Then you will be able to use firebase auth for phone number authentication.

Nsengiyunva avatar Dec 02 '21 12:12 Nsengiyunva

please review change in config explained here (relevant to Flutter as to React Native) https://stackoverflow.com/questions/74340881/invalid-app-credential-token-mismatch-in-flutter-firebase-auth

yoavprat avatar Nov 13 '22 10:11 yoavprat

Thanks for the solution! It's work!

bardaxx avatar Feb 24 '23 11:02 bardaxx

I resolved this issue. I create Apple Development IO Push Services and Apple Push Services. image

download both certificate. export them to .p12 and add to firebase console. NOT add file .p8 image hope that help to you.

Lmao, I'd have NEVER figured that out myself. Thanks :)

jimmy123A avatar Mar 18 '23 21:03 jimmy123A

But it was working. Why it's not working after few days... hm.

lasharela avatar Jun 17 '23 19:06 lasharela

my app use expo and expo notifications and firebase functions. When push notifications successfully then can not sign in by phone authentication to firebase. It occurs this error: auth/invalid-app-credential. Anyone could fix this please help me? I have tried to fix this like a month.

Thanks you

nanokoko89 avatar Aug 28 '23 09:08 nanokoko89

Thanks for the solution, It works great

DevTwana avatar Sep 05 '23 07:09 DevTwana

or you simply deleted your push notification key because you didn't consider it is also used in the auth process...

luckyhandler avatar Dec 20 '23 16:12 luckyhandler

it works!

geoffcfchen avatar Mar 13 '24 08:03 geoffcfchen

I love you man! i tried a lot of things and only this solution works for me ❤️ ❤️ ❤️ ❤️

moscchi avatar Jul 03 '24 13:07 moscchi

my app use expo and expo notifications and firebase functions. When push notifications successfully then can not sign in by phone authentication to firebase. It occurs this error: auth/invalid-app-credential. Anyone could fix this please help me? I have tried to fix this like a month.

Thanks you

Hey, I'm in the same situation. Did you manage to solve it?

AmitayCohen1 avatar Jul 23 '24 09:07 AmitayCohen1

For anyone coming from React Native Firebase using Expo managed project - The solution is indeed to add the APN key to Firebase > Project settings > Cloud Messaging "APNs Authentication Key" section. To download it (I already had 2 in the Apple account and wasn't able to download it or create a new one) I went to the expo.dev website and then to the app > IOS > credentials and downloaded it from there (the .p8 file) and uploaded it to the firebase appropriate place.

AmitayCohen1 avatar Jul 23 '24 10:07 AmitayCohen1

@chellongCoder you suggest solution, after what changes in native file appdelegate.h or appdelegate.m in iOS please help to which change in android that show error like

[Error: [auth/billing-not] An internal error has occurred. [ BILLING_NOT_ENABLED ]]

wolfxpertlab avatar Sep 06 '24 07:09 wolfxpertlab

I am using onesignal for push notification and firebase authentication for phone number OTP based login, still do i need to add APN in firebase ?

priyanshi-chhabra avatar Aug 20 '26 15:08 priyanshi-chhabra

@priyanshi-chhabra

Phone auth requires app verification, and the automatic app verification process uses data-only firebase cloud messages to the app. Data-only cloud messaging only works on real devices where the app has background refresh enabled. If background refresh disabled, or if using the Simulator, app verification uses the fallback reCAPTCHA flow allowing you to check if it is configured correctly.

https://rnfirebase.io/auth/phone-auth#ios-setup

Feel free to skip that step, but you will have to accept all clients getting reCAPTCHA instead.

mikehardy avatar Aug 20 '26 22:08 mikehardy