Skip to content

Instantly share code, notes, and snippets.

@haranicle
Created December 12, 2016 02:47
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 haranicle/cd7c0aa52ef8b9b80729ae856d73f746 to your computer and use it in GitHub Desktop.
Save haranicle/cd7c0aa52ef8b9b80729ae856d73f746 to your computer and use it in GitHub Desktop.
#!/bin/sh
# settings
DEVICE_TOKEN="XXXXXX"
TOPIC="com.your.app.bundle.id"
# process
DATE="`date \"+%Y/%m/%d %H:%M:%S\"`"
curl -v -d '{"aps": {"alert": {"title" : "push test" ,"body": "'"${DATE}"'"}, "sound": "default", "badge": 0, "content-available": 1} }' -H "apns-priority: 10" -H "apns-expiration: 0" -H "apns-topic: `"${TOPIC}"`" --http2 --cert privatekey.pem https://api.development.push.apple.com/3/device/"${DEVICE_TOKEN}"
echo "🚀 💥 📱 push_id = ${DATE}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment