Skip to content

Instantly share code, notes, and snippets.

@hackugyo
Created December 3, 2014 09:20
Show Gist options
  • Select an option

  • Save hackugyo/f97aba5c94d0ce37a08b to your computer and use it in GitHub Desktop.

Select an option

Save hackugyo/f97aba5c94d0ce37a08b to your computer and use it in GitHub Desktop.
GCMのテストスクリプト
#!/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