Skip to content

Instantly share code, notes, and snippets.

@ademar111190
Created June 22, 2016 17:51
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ademar111190/780893dd5af0af36aeb48e29f1bfa503 to your computer and use it in GitHub Desktop.
Save ademar111190/780893dd5af0af36aeb48e29f1bfa503 to your computer and use it in GitHub Desktop.
A script to send data notifications
#!/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"
@noppol2555
Copy link

Hey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment