After update to newest Firebase there is not method for getting FCM registration token for selected fcmSenderId:
FirebaseInstanceId
.getInstance()
.getToken(fcmSenderId, "FCM")
Documentation says to use FirebaseMessaging instead (https://firebase.google.com/docs/reference/android/com/google/firebase/messaging/FirebaseMessaging#getToken()):
FirebaseMessaging
.getInstance()
.token
.addOnCompleteListener { task ->
if (task.isSuccessful) {
task.result?.let { token ->
println(token)
}
} else {
println(task.exception)
}
}
but this method doesn't allow to provide custom FCM Sender Id.
The project has configured google-services.json but need to use another FCM project.