Created
September 15, 2016 20:28
-
-
Save MosheBerman/67e0399c3dc593f06fe57c8f7086ece0 to your computer and use it in GitHub Desktop.
A testbed for Firebase Cloud Messaging.
This file contains hidden or 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
import requests | |
import json | |
url = "https://fcm.googleapis.com/fcm/send" | |
project_key = "firebase-dashboard-project-key" | |
headers = { | |
"Authorization": "key={}".format(project_key), | |
"Content-Type": "application/json" | |
} | |
payload = { | |
'registration_ids': ['app-generated-registration-ids-here'], | |
'notification': { | |
"title": "This is SPARTA", | |
"text": "This is the text" | |
} | |
} | |
response = requests.post(url, data=json.dumps(payload), headers=headers) | |
response.json() |
Author
MosheBerman
commented
Sep 15, 2016
- @nrschultz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment