https://github.com/dcai/android-gcm-client-app
An android app to test gcm
https://github.com/dcai/android-gcm-client-app
Last synced: 6 days ago
JSON representation
An android app to test gcm
- Host: GitHub
- URL: https://github.com/dcai/android-gcm-client-app
- Owner: dcai
- Created: 2014-03-17T14:07:28.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-03-09T10:57:44.000Z (over 11 years ago)
- Last Synced: 2024-04-15T01:57:34.107Z (about 2 years ago)
- Language: Java
- Size: 1.95 MB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
Import this project into eclipse.
1. you need to go through GCM setup: http://developer.android.com/google/gcm/gs.html, store project number in android app (take a look at DemoActivity.java, SEND_ID field), then add API key in airnotifier admin panel
2. The android app requires external jars, so you need to take a look at http://developer.android.com/google/gcm/client.html and add google play services jars to the project
3. The interesting part is GcmIntentService.onHandleIntent method, it extract the notification posted from AirNotifier, same as iOS platform, we use alert for notification message, additionally, android could process more params, just send all them to /notification/ endpoint
It's possible to run it in emulator, I did that on a physical device, please note you need to obtain the device registration id (known as token on iOS) from the LogCat console (set filter to tag:GCM) before sending messages from AirNotifier.
On AirNotifier side:
1. Run upgrade.py script (backup existing mongodb data of course)
2. /notification/ endpoint requires device param, if not supplied, it would be considered to be an ios device
3. please use 'moodle' branch on github, it has moodle specific changes