Skip to content

Instantly share code, notes, and snippets.

@PAX523
Forked from ademar111190/firebase.sh
Created April 6, 2021 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PAX523/c34e5705b709156b721114125a4ccf82 to your computer and use it in GitHub Desktop.
Save PAX523/c34e5705b709156b721114125a4ccf82 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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment