A Titanium module for registering a device with Firebase Cloud Messaging and handling push notifications sent to the device.
Read the documentation.
- Install this module using Axway Studio or via the CLI with
gittio install nl.vanvianen.android.gcm
- Set up your Firebase project.
- Download the
google-services.json
file and put it inPROJECT_FOLDER/app/assets/android/
(orPROJECT_FOLDER/Resources/android/
for non-Alloy projects). - You are ready to receive Android push notifications! Check the documentation for further instructions and examples.
If you are upgrading this module to version 3.0+, you will need to migrate to Firebase (Google will discontinue GCM in April 2019):
- In the Firebase console, select Add Project
- Select your GCM project from the list of existing Google Cloud Projects, and select Add Firebase
- In the Firebase welcome screen, select Add Firebase to your Android App
- Provide your package name (and optionally an SHA1 from your keystore) and select Add App. A new
google-services.json
file for your Firebase app is downloaded. Place this file inPROJECT_FOLDER/app/assets/android/
(orPROJECT_FOLDER/Resources/android/
for non-Alloy projects). - Update to version 3.0+ of this module
- Check the Upgrade Guide for instructions about what needs to be altered in your code
To build this module, you will need the prerequisites described in the Android Module Project documentation.
Then, simply cd
into the module directory and run the following command:
$ appc ti build -p android --build-only
OR, if you are using just the open-source Titanium SDK:
$ ti build -p android --build-only
A zip file will be created in the dist
folder.