Migrating to FCM
Batch 1.12 brings full FCM support. While new integrations will automatically use it, applications that already used Batch require some changes to explicitly opt-in to a FCM migration. We strongly recommend that you update your app as soon as possible.
This documentation describes how to perform this migration.
Adding Firebase to your project
First, you'll need to make sure that Firebase is fully integrated into your application.
If not, you can follow Firebase's Get Started guide. You can also use Android Studio:
Open the "Tools" menu, and select "Firebase"
In the panel that opened, select "Cloud Messaging", and click on "Set up Firebase Cloud Messaging"
Follow the steps "Connect your app to Firebase" and "Add FCM to your app". Batch already handles the next steps for you.
Your build.gradle
should contain at least firebase-core
and firebase-messaging
:
Finally, make sure you updated Batch to 1.12 or higher.
Removing deprecated manifest entries
From your Android manifest please remove, if present, the following items:
BatchPushService
BatchPushReceiver
BatchPushInstanceIDService
Removing old GCM Sender ID
Finally, open up your Application subclass, and delete your Batch.Push.setGCMSenderID()
call.
The Sender ID is now read directly from Firebase's configuration.
Testing it
Once you've done this, the log with your registration ID should change, and say that it is using FCM:
If you see GCM
instead of FCM
or an error, please try to follow the documentation again, or contact us.
Last updated
Was this helpful?