Skip to content

Background

Previously, all native mobile push notifications to Android devices, whether sent by Kumulos or any other vendor, used Google Cloud Messaging (GCM). Google then released Firebase Cloud Messaging (FCM), which offers broadly the same functionality.

Google have announced that on April 11th 2019, the GCM servers will be removed and that all apps must use FCM instead. If you are using our native Android SDK, this guide describes the steps you need to take to update your app to FCM.

Please note that this applies to deprecated push features only and that other GCM classes such as GcmNetworkManager are still supported.

Update the Kumulos SDK

While the Kumulos SDK source code is available on GitHub, the libraries are distributed through JCenter. Update your app's build.gradle file to install the latest version of these libraries. It should look something like this:

android {
    // Exclude duplicate files from the build
    packagingOptions {
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/LICENSE'
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    // Kumulos debug & release libraries
    debugImplementation 'com.kumulos.android:kumulos-android-debug:6.0.0'
    releaseImplementation 'com.kumulos.android:kumulos-android-release:6.0.0'
}

At the time of writing, the latest version of the Kumulos library is v6.0.0 - see the Changelog for further updates.

Remove GCM

Remove the kumulos_gcm_sender_id manifest placeholder from your app's build.gradle file. The code you need to remove, will look something like this.

manifestPlaceholders = [
    kumulos_gcm_sender_id: '[YOUR_SENDER_ID]'
]

Integrate FCM

Now you are ready to integrate FCM into your app.

Import your existing GCM project into FCM

If you have not already done so, you'll need to import your existing GCM project into FCM as shown in the following video guide.

Integrate FCM for Push Notifications

For apps created within the last 2 years, it is likely that you were already using your FCM server key to in your Kumulos configuration.

Integrate the SDK

To begin, ensure you have added the Firebase components to your app as shown below.

In the root build.gradle, ensure the Google repository is enabled and the google-services plugin is on the classpath:

buildscript {
   // ...
   dependencies {
       // ...
       classpath 'com.google.gms:google-services:4.3.8' // google-services plugin
   }
}

allprojects {
   // ...
   repositories {
       google() // Google's Maven repository
       // ...
   }
}

Now, in your app module's build.gradle, add the Firebase core SDK and apply the google-services plugin:

apply plugin: 'com.android.application'

dependencies {
   // ...
   implementation 'com.google.firebase:firebase-core:16.0.7'
}

// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'

By default, the Firebase SDK will send analytics data to Google. To disable this, simply add <meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" /> to your app's AndroidManifest.xml

Then, download the google-services.json file from your Firebase app 'General' settings, and add it to your app/ folder.

Finally, you can add the Kumulos FirebaseMessagingService and PushBroadcastReceiver to your AndroidManifest.xml.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.example">

   <!-- Optionally add the wake lock permission to stop the CPU from sleeping when a message is received -->
   <!-- <uses-permission android:name="android.permission.WAKE_LOCK" /> -->

   <application
       android:name=".ExampleApp"
       android:allowBackup="true"
       android:icon="@mipmap/ic_launcher"
       android:label="@string/app_name"
       android:supportsRtl="true"
       android:theme="@style/AppTheme">

       ...

       <!-- Kumulos FCM handler -->
       <service android:name="com.kumulos.android.FirebaseMessagingService">
           <intent-filter>
               <action android:name="com.google.firebase.MESSAGING_EVENT" />
           </intent-filter>
       </service>

       <!-- Kumulos Push receiver -->
       <receiver android:name="com.kumulos.android.PushBroadcastReceiver" android:exported="false">
           <intent-filter>
               <action android:name="com.kumulos.push.RECEIVED" />
               <action android:name="com.kumulos.push.OPENED" />
               <action android:name="com.kumulos.push.BUTTON_CLICKED" />
           </intent-filter>
       </receiver>
   </application>

</manifest>

That's it! All existing push tokens and Kumulos configuration remains valid and requires no action to update.

Checking Push Registrations

When you run your app on a simulator or install your app on a device, you can check that the install has successfully registered for push notifications by selecting the app and clicking the Installs tab to see the ten most recent installs of your app. Click on any install and then click on Push tab.

Install push details

Technical support

If you have any questions or require guidance on how best to use Kumulos with your app project, then please do not hesitate to contact our technical support team, staffed by mobile app developers, who will be happy to point you in the right direction.

You can contact technical support from your agency console by clicking on the down arrow next to your login, selecting Account Settings and then Support from the left-hand menu.

Tech Support Form

Enter your first and last names as well as a contact telephone number or Skype ID in case we need to speak to you in person. These will be saved with your login so you won't need to enter them again if you contact tech support in the future. Tell us the subject of your question, provide a detailed description and click Contact.

You will receive an email confirming that a ticket has been opened and a member of our technical support team should respond within a working day.