Created
January 8, 2016 13:48
-
-
Save soulfly/eea86e833d53f5aa7e3d to your computer and use it in GitHub Desktop.
python_gcm_sender
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gcm import GCM | |
API_KEY = "..." | |
gcm = GCM(API_KEY) | |
data = {'param1': 'value1', 'param2': 'value2'} | |
# JSON request | |
reg_ids = ['...'] | |
response = gcm.json_request(registration_ids=reg_ids, data=data) | |
# Extra arguments | |
res = gcm.json_request( | |
registration_ids=reg_ids, data=data, | |
collapse_key='uptoyou', delay_while_idle=True, time_to_live=3600 | |
) | |
print res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment