I am trying to run demo given here. The problem is whenever app tries to register instanceId, it say "background sync failed: MISSING_INSTANCEID_SERVICE, retry in 320s" and then when I print token, it says token is null. I tried changing INSTANCE_ID_EVENT
instead of INSTANCEID_EVENT
and other solution that were previously asked on stackoverflow, but none of them works for me.
FirebaseInstanceId is deprecated but now you can use FirebaseMessaging. getInstance(). token.
The token can be generated using the following code: FirebaseMessaging. getInstance(). getToken() .
The Instance ID API lets you integrate Instance ID with your Android or iOS app. Instance ID provides a unique identifier for each instance of your app and a mechanism to authenticate and authorize actions, like sending messages via Firebase Cloud Messaging.
Firebase Cloud Messaging Platform (formerly named as GCM) is a free mobile notification service by Google that enables (third-party) app developers to send notifications from GCM (Google Cloud Messaging) servers to their users.
Firebase won't run without Google Play Services, so check if they are available.
When running on the emulator, use an image with the Google APIs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With