Created
June 22, 2016 17:51
-
-
Save ademar111190/780893dd5af0af36aeb48e29f1bfa503 to your computer and use it in GitHub Desktop.
A script to send data notifications
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
#!/bin/bash | |
# https://github.com/firebase/firebase-tools | |
# https://firebase.google.com/docs/cloud-messaging/server | |
DEVICE="<< DEVICE TOKEN >>" | |
KEY="<< SERVER KEY>>" | |
JSON=" | |
{ | |
\"to\": \"$DEVICE\", | |
\"data\": { | |
\"key_a\": \"Some text here\", | |
\"key_b\": 111190 | |
} | |
} | |
" | |
curl -X POST \ | |
--header "Authorization: key=$KEY" \ | |
--Header "Content-Type: application/json" \ | |
https://fcm.googleapis.com/fcm/send \ | |
-d "$JSON" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey