-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIS_AUTH_ERROR - when trying to getToken() #5522
Comments
I got the same issue; package.json versions:
Code I tried in App.js
Log Snapshot: Best, |
Problem has been solved, steps need to do, First check the react-native-push-notification is configured correctly then run the code with works perfect and get the token index.js
App.js
Best, |
I don't use react-native-push-notification. I created a new firebase project, added android app, downloaded google-services.json. Still same error. export const checkPermission = () => {
messaging().hasPermission().then((enabled) => {
if (enabled) {
getToken();
} else {
requestPermission();
}
}).catch((error) => {
console.log('Error checking permissions ' + error);
});
};
const requestPermission = () => {
messaging().requestPermission().then(() => {
getToken();
}).catch((error) => {
console.log('Permission rejected ' + error);
});
};
const getToken = () => {
messaging().getToken().then((token) => {
console.log(token);
}).catch((error) => {
console.log('Error getting push token ' + error);
});
}; |
Not sure what is going on, but it is definitely centered around your API key. Something is not what it appears to be with regard to the key actually in use by the app, and how it is configured. This seemed like a reasonable explanation of the above to consult https://stackoverflow.com/questions/61453640/android-error-when-communicating-with-the-firebase-installations-server-api/61529757#61529757 - you indicate you've set up a few apps before so it's likely unexpected and you've been through this, yet still there is something wrong in exactly this API key area around Firebase Installations |
@mikehardy I did what that post did. I also tried to make a new firebase project with a new android app. I tried to delete the whole app from device and remove all the build folders. Nothing is working, I just don't get it :( |
Anybody else got any other ideas about what the problem could be. I have checked my API key so many times already. The API key in the google-services.json is the same as in the google cloud platform. |
I'm getting the same problem...not sure what is up |
It looks like I fixed it by downgrading the minor version...not sure what they changed. "@react-native-firebase/app": "^12.0.0",
"@react-native-firebase/messaging": "^12.0.0", |
That's really unexpected. I wonder if this would be resolved by downloading a new set of google-services json/plist files? (this was required for a similar error when firebase underlying SDKs were bumped - it would be an unexpected side effect of the SDK bump in that case and I'll have to think about updating the changelog...) |
Downgraded versions to 12.0.0 and redownloaded config, same problem. |
Did you make sure you reinstalled version via npm and it is in fact 12.0.0?
…On Thu, Jul 22, 2021 at 12:01 AM MaxEmbregts ***@***.***> wrote:
Downgraded versions to 12.0.0 and redownloaded config, same problem.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5522 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAUHYGI5IPOQ6POCFRJFD7DTY663HANCNFSM5APAALTA>
.
|
Yes, its reinstalled with npm. Version 12.0.0 for both. |
After days of trying to find a solution and frustration, I finally found a solution to my problem. In my app im using ssl pinning and apparently that was causing the issue. I found this post on stackoverflow: https://stackoverflow.com/questions/60698622/java-io-ioexception-fis-auth-error-in-android-firebase In this post if you scroll down enough you will find this: "Hope this helps someone: In my situation, I used self-signed ca. So I need to use network-security-config.xml After huge try and error, finally I add system directory in trust-anchors like below, FIS_AUTH_ERROR is gone and Firebase worked."
This file is found in: android/app/src/main/res/xml/network-security-config.xml This basically fixed my problem. Finally. Thanks for all the other responses and help though. |
@mikehardy well I just created a new firebase project with the latest downloads so maybe check against that. |
@timothyerwin I'm not sure how that is relevant. I'm not having this issue, just 3 hours ago someone reported success (after unrestricting security chain a bit...) with current versions. To me that means: react-native-firebase + firebase is working. Your project and/or API key and/or SSL config is not working. That's not an issue I here I don't think? |
@mikehardy I'm just responding to your earlier comment:
I'm not sure why you want to paint this as a me problem when I'm clearly not the only one having this. If I downgrade a minor version and things suddenly work how is it a me problem now? lol...yes, other people have solved this after tinkering around with things and mentioning "days of frustration"...but I guess everyone else is the issue... :) |
There are lots of reasons it can happen, for every person that has had it, it is a "me" problem yes. Based on the fact it is possible for it to work, it is not a module problem. As a maintainer, with apologies, that is my vital interest --> I must fix bugs in the module. With whatever time I have left over I can try to offer help, but if it's not a module bug it's project issue, it's a bit binary in that way |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hey @timothyerwin I mean this sincerely: I would welcome any documentation PR that sums up whatever specific project-specific items may need attention based on whatever evidence is posted here. We have a tips and tricks section for this purpose, and there's an edit button on the top right https://rnfirebase.io/faqs-and-tips - the project's not perfect and the documentation is largely improved by users, in this specific area the project is working though. Yet users are still having issues for what appears to be a wide variety of reasons. Any help untangling that could save future devs a lot of time, and that would be a plus |
I also had this issue, I solved this by manually removing the current_key under api_key object on google-services.json. Apparently Google put other Firebase app API key as well and those keys are restricted (while my test project key is not). Hope this helps future devs some time |
I was switching a project from v5 to v14 in an App & caught this issue while generating token. What I've missed to add while migrating is
Token is generated successfully after adding this line. |
@mashish584 something is wrong - that should not be necessary, we do that for you right here:
|
@mikehardy Bit strange for me as well because in other projects it's working fine without adding "firebase-bom". I'll try to inspect it on my end once I got some time. |
@maxembregts thank you SO much. Ran into this same issue because of SSL pinning. You saved me hours of (more) digging. |
This solution worked for me, not sure how the API key got replaced |
The fix for me was to update the API key to include these two permissions:
|
in my case problem was wrong google-services.json file (was copied from other prjoect before) after I changed it by correct one from firebase console, everything started working |
after solved my issue and I found your it's correct
|
Hi,
So the problem im having is that when i do the getToken() call on android i get this error in my google developer tools:
[messaging/unknown] java.io.IOException: java.util.concurrent.ExecutionException: java.io.IOException: FIS_AUTH_ERROR
and this error in android studio logcat:
E/FirebaseMessaging: Failed to get FIS auth token
java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.
The steps i have taken to setup my android project in firebase:
I have tried with and without the SHA-1 key, no difference.
I have tried with and without restrictions, no difference. With restrictions i added these api's:
Cloud Messaging
FCM Registration API
Firebase Cloud Messaging API
Firebase Installations API
Im using the current google-services.json that firebase console gives me when i download it.
I also tried to do a curl command. The curl command gave PERMISSION_DENIED back when i had restrictions on (only those 4 mentioned api's above). The curl command gave this response without restrictions:
package.json:
On iOS everything is working fine. I have setup numerous projects with firebase messaging and never had this happen so im quite confused about this whole situation.
If anybody knows whats going on, please let me know.
Greetings,
Max Embregts
The text was updated successfully, but these errors were encountered: