FirebaseMessaging.getInstance().getToken()
- By saramarz
- Android Development
- 2 Replies
There could be several reasons why the FCM token is not being generated when you build the app for publishing on Google Play Store. Here are a few things you can try to troubleshoot the issue:
- Make sure that you have correctly added the required dependencies in your app-level build.gradle file.
- Check if you have enabled the required services in the Firebase console. Go to the Firebase console, select your project, and make sure that the Cloud Messaging service is enabled.
- Make sure that you have added the required metadata to your app's AndroidManifest.xml file. This includes the google-services plugin, the FCM service, and the internet permission.
- Check if you have correctly configured your app's SHA-1 key in the Firebase console. Go to the Firebase console, select your project, and add your app's SHA-1 key in the "Settings" > "General" section.
- If you are using a physical device to test your app, check if the device has a working internet connection.
