firebase phone auth Error: auth/invalid-app-credential Invalid token.
I resolved this issue.
I create Apple Development IO Push Services and Apple Push Services.

download both certificate.
export them to .p12 and add to firebase console. NOT add file .p8
hope that help to you.
@chellongCoder Thank you for providing a resolution to your problem.
I follow your but seem like not working at all. My app is on TestFlight, after download it error auth/invalid-app-credential
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.
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
Thanks for the solution! It's work!
I resolved this issue. I create Apple Development IO Push Services and Apple Push Services.
download both certificate. export them to .p12 and add to firebase console. NOT add file .p8
hope that help to you.
Lmao, I'd have NEVER figured that out myself. Thanks :)
But it was working. Why it's not working after few days... hm.
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
Thanks for the solution, It works great
or you simply deleted your push notification key because you didn't consider it is also used in the auth process...
it works!
I love you man! i tried a lot of things and only this solution works for me ❤️ ❤️ ❤️ ❤️
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?
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.
@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 ]]
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
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.