Skip to content

Instantly share code, notes, and snippets.

@mehmetcanker
Forked from ademar111190/firebase.sh
Created February 28, 2019 09:00
Show Gist options
  • Select an option

  • Save mehmetcanker/b1cac0c88faffca986d17dddeb2c95a5 to your computer and use it in GitHub Desktop.

Select an option

Save mehmetcanker/b1cac0c88faffca986d17dddeb2c95a5 to your computer and use it in GitHub Desktop.

Revisions

  1. @ademar111190 ademar111190 created this gist Jun 22, 2016.
    22 changes: 22 additions & 0 deletions firebase.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #!/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"