GCM
The Google Cloud Messaging enables you to command the collect installed on your mobile applications from the web dashboard.
INFO: On top of enabling remote control, GCM will automatically update your collects when you deploy them.
Enables GCM on Android
To use GCM on an Android application, you have to :
- Create a GCM project here
- The installation instructions are slightly changed. You’ll have to:
- Copy the generated
google-services.json
to your project’sapp
folder. - Add the GCM plugin (which will use the previous file) to your gradle configuration:
- In your
buildscript.dependencies
, addclasspath 'com.google.gms:google-services:3.0.0'
- Apply the plugin:
apply plugin: 'com.google.gms.google-services'
- In your
-
Register the following receivers and services into your
AndroidManifest.xml
:<service android:name="io.apisense.sdk.push.APSGcmListenerService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> <service android:name="io.apisense.sdk.push.RegistrationIntentService" android:exported="false"> <intent-filter> <action android:name="io.apisense.sdk.gcm.register"/> <action android:name="io.apisense.sdk.gcm.pubsub.register"/> <action android:name="io.apisense.sdk.gcm.pubsub.unsubscribe"/> <category android:name="io.apisense.sdk.push"/> </intent-filter> </service> <activity android:name="io.apisense.sdk.push.APSGcmNotificationHandlerActivity"> <intent-filter> <action android:name="HANDLE_APISENSE_PUSH" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity>
- Copy the generated
Enables GCM notifications on the dashboard
Once you prepared your application to receive GCM notification from APISENSE, you will have to activate the feature on the dashboard:
- On your home page, click on
edit Profile
- Go to the section
Mobile Applications
- Fill in the form with:
- Your application name, which is only a reminder for you.
- The server GCM key that APISENSE can use to send notifications.
- In case of a notification, set the values you want to use on it.
- Confirm the form, your collects can now be remote controlled.