Google recently announced that it would be deprecating Google Cloud Messaging (GCM) in favor of Firebase Cloud Messaging (FCM). As a result, we are advising all customers to update their Android apps from using GCM to using FCM if necessary.
Determining Which Push Service Your App Uses
Your developers should be able to tell you if your Android app is currently using GCM or FCM.
Alternatively, you can use Rapid Push Verification to see which service your app currently uses. To do this, go to Settings in the Localytics Dashboard, find the app you are interested in and click the blue button that says Test Push Integration. Once you get to Step 3 and scan the QR code, you should see a screen that looks like the image below. The push service your app currently uses can be found in the bottom left corner:
Migrating to FCM
Generally, Google’s migration guide should be followed. However, we will add a few additional notes to ensure your Localytics integration should still be compliant.
- Ensure that your app is integrated with SDK v5 or higher.
- Follow steps 1 and 2 of the Google Migration guide.
- Follow step 3, but please don’t remove the wake lock block as suggested by Google:
<uses-permission android:name "android.permission.WAKE_LOCK" />
- Update your push receivers (this step assumes SDK 5+):
a. Remove thell_gcm_sender_id
key from yourlocalytics.xml
.
b. For customers who use Localytics push receivers and services setll_fcm_push_services_enabled
totrue
.
c. For customers who use custom push receivers, update your old receivers to extend the Firebase push servicesFirebaseInstanceIdService
andFirebaseMessagingService
.
Google provides migration guides on these steps here and here.
This integration covers Native Android integrations, in addition to the React-Native and Cordova wrappers. For Xamarin, please consult Microsoft’s documentation.
Server Integration
Firebase continues to support GCM Server API keys. If you still have an active GCM Server key as provided by Google, that key should continue to work in the Localytics system, and it is not required to upload anything new to the Localytics dashboard.
Testing
Once you have a new build of the app, please take a moment to use Rapid Push Verification to ensure your push integration is behaving properly. Once again, Rapid Push Verification relies on proper test mode integration.