-
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
[🐛] auth().currentUser.getIdToken() blocks indefinitely on Android #8394
Comments
Historically, this is related to API key restrictions in the cloud specific to your app, or SSL certificate pinning on device if I recall the causes correctly No one else is reporting this problem so it's very unlikely it has anything to do with react-native-firebase (or you can believe it would it be a hot topic here!), whereas it's definitely been project-specific in the past |
Hey there, you can try |
Thanks for your responses. I've tried calling auth().currentUser.getIdToken(true), but unfortunately, it doesn't change anything. To rule out API key restrictions, I removed all restrictions from my Firebase API key, but that didn’t help either. I even performed a factory reset on my Android phone, yet the issue persists. Interestingly, everything works fine on another user's device, which suggests the problem is specific to my phone. Could this be related to a specific configuration or hardware issue? I’m not sure if SSL certificate pinning is enabled on my device, but since I did a factory reset, I would have expected it to be cleared. Do you have any suggestions on how I could check or resolve this? |
Hey there, @PierreMartin that is possible, what device do you have? |
@MichaelVerdon I have a Samsung Galaxy A03 Core (SM-A032F), version Android 13. The phone doesn't have a SIM card, I use WIFI. |
We have seen a similar issue only on Pixel devices, downgrading to |
@diego-paired I have downgraded to version 21.7.0, but the issue persists on my phone |
Hey there @PierreMartin I think it is important to see whether the token request is actually fired or not from the app. Here is an example of how that can be done here. Since you seem to be using a physical device, Im not sure if this is a personal device or a device used for testing but this could be of help just in case background processes are being killed. https://dontkillmyapp.com/samsung Let me know how this goes or if you have any more questions. 😄 After all this, we should hopefully know if it is an sdk issue or device. |
Issue
I am facing an issue with the getIdToken() method from @react-native-firebase/auth on Android. The issue occurs when trying to retrieve the ID token after the user has been authenticated for around 1 hour. The call to auth().currentUser.getIdToken() hangs indefinitely, neither resolving nor rejecting. However, this issue does not occur on iOS.
It seems to be related to the token refresh mechanism. On Android, after 1 hour, the token retrieval process gets stuck and doesn't return a result, even though auth().currentUser is still available.
Here is the code I am using:
Project Files
Javascript
Click To Expand
package.json
:firebase.json
for react-native-firebase v6:iOS
Click To Expand
ios/Podfile
:# N/A
AppDelegate.m
:// N/A
Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:android/app/build.gradle
:android/settings.gradle
:MainApplication.kt
:AndroidManifest.xml
:Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:21.11.0
Firebase
module(s) you're using that has the issue:@react-native-firebase/auth
TypeScript
?Yes, V5.0.4
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: