Created
December 3, 2014 09:20
-
-
Save hackugyo/f97aba5c94d0ce37a08b to your computer and use it in GitHub Desktop.
GCMのテストスクリプト
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 | |
| REQUIRED_ARGS=3 | |
| if [ $# -ne $REQUIRED_ARGS ] | |
| then | |
| echo "" | |
| echo "Usage:" | |
| echo "./gcm_send_test.sh [server_api_key] [registration_id] [message]" | |
| echo "" | |
| exit 1 | |
| fi; | |
| echo "" | |
| curl --header "Authorization: key=$1" --header Content-Type:"application/json" https://android.googleapis.com/gcm/send -d "{\"registration_ids\":[\"$2\"],\"data\":{\"message\":\"$3\"}}" | |
| echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment