Open Ankitanni opened 3 years ago
I am also facing the same problem
"react-native": "0.59.10" "react-native-fcm": "16.2.4",
Running on android device and android emulator is failed
My project is not running suddenly with the following error. Please help.
this project is deprecated
dependencies
{
implementation 'com.google.firebase:firebase-core:17.2.1'
}
use this dependency in your build.gradle Module dependency
as per official doc - https://firebase.google.com/docs/cloud-messaging/android/client#retrieve-the-current-registration-token
with implementation 'com.google.firebase:firebase-messaging:23.0.0'
need to use - FirebaseMessaging.getInstance().token.addOnCompleteListener(OnCompleteListener { task -> if (!task.isSuccessful) { toast(getString(R.string.fcm_token_fetch_error)) return@OnCompleteListener } val token = task.result updateFcmToken(token) })
fun setNewFcm() {
FirebaseMessaging.getInstance().token.addOnCompleteListener { task ->
if (!task.isSuccessful) {
return@addOnCompleteListener
}
if (task.result != null) {
val token: String = task.result
AppSharedData.setFcmToken(token)
}
}
}
Before openning an issue
When openning an issue, please include following information for better support