Professional Documents
Culture Documents
Django GCM Android Ios
Django GCM Android Ios
Documentation
Release 1.0.0
Hugo Brilhante
1 Tutorial 3
1.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Sending messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Author 5
3 Main features 7
4 Links 9
5 References 11
6 License 13
i
ii
django-gcm-android-ios Documentation, Release 1.0.0
django-gcm-android-ios is a simple Django app to send a message using Google Cloud Messaging HTTP connection
server protocol. Contents:
Contents 1
django-gcm-android-ios Documentation, Release 1.0.0
2 Contents
CHAPTER 1
Tutorial
Installation
Install o django-gcm-android-ios:
pip install django-gcm-android-ios
Configuration
You can easily test if the endpoint is working by doing the following in your terminal
Register:
curl -X POST -H "Content-Type: application/json" -H "Authorization: " -d '{
"dev_id": "Device id",
"dev_type": "ANDROID or IOS",
"reg_id": "Register id"
}' 'http://localhost:8001/api/devices'
Unregister:
3
django-gcm-android-ios Documentation, Release 1.0.0
Sending messages
device = Device.objects.get(dev_id=<dev_id>)
Note: For more information, see GCM Connection Server Reference docs.
Multicast message
django-gcm-android-ios supports sending message to multiple devices at once:
from gcm.utils import get_device_model
Device = get_device_model()
Device.objects.all().send_messages('my message')
Payload
django-gcm-android-ios supports sending payload:
from gcm.utils import get_device_model
Device = get_device_model()
device = Device.objects.get(dev_id=<dev_id>)
4 Chapter 1. Tutorial
CHAPTER 2
Author
• Hugo Brilhante
5
django-gcm-android-ios Documentation, Release 1.0.0
6 Chapter 2. Author
CHAPTER 3
Main features
7
django-gcm-android-ios Documentation, Release 1.0.0
Links
• Github
• Travis CI
• Coveralls
9
django-gcm-android-ios Documentation, Release 1.0.0
10 Chapter 4. Links
CHAPTER 5
References
11
django-gcm-android-ios Documentation, Release 1.0.0
12 Chapter 5. References
CHAPTER 6
License
13