Skip to content

Instantly share code, notes, and snippets.

@danielthiel
Created April 18, 2014 22:27
Show Gist options
  • Save danielthiel/11067026 to your computer and use it in GitHub Desktop.
Save danielthiel/11067026 to your computer and use it in GitHub Desktop.
GCM (Google Cloud Messaging) in Python
"""
https://developer.android.com/google/gcm/index.html
https://github.com/geeknam/python-gcm
"""
from gcm import GCM
API_KEY = 'secret'
DEVICE_REG_ID = 'some_registrated_device_id'
gcm = GCM(API_KEY)
data = {'message': 'value1', 'title': 'value2'}
gcm.plaintext_request(registration_id=DEVICE_REG_ID, data=data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment