Open
Description
- Firebase Component: firebase-messaging
- Component version: 24.0.1
Describe the problem
Steps to reproduce:
For some users, attempting to get the token returns this error:
Fetching the token failed: java.util.concurrent.ExecutionException: java.io.IOException: Invalid argument for the given fid.
Here's a related issue that shows a full stack trace: #6914
Relevant Code:
FirebaseMessaging.getInstance().token
.addOnCompleteListener { task ->
if (!task.isSuccessful) {
val exception = task.exception
promise.reject(REGISTRATION_FAIL_CODE, "Fetching the token failed: ${exception?.message ?: "unknown"}", exception)
return@addOnCompleteListener
}
// ...
}
Note: I am using this through a library called expo-notifications, so you can see all the code here: https://github.com/expo/expo/blob/c46aeff68ecf6747d792b530482f2c88111cff39/packages/expo-notifications/android/src/main/java/expo/modules/notifications/tokens/PushTokenModule.kt#L51