A super light-weight Apple push notification service.
- No database
- No configurations
- No UI
$ heorku create
$ cp apple_push_notification.pem .
$ git add .
$ git commit -am "Add .pem"
$ git push heroku master
If you use production .pem:
$ heroku config:add APN_ENVIRONMENT=production
$ export APN_CERTIFICATE_BASE64=`bundle exec rake APN_CERTIFICATE=/path/to/aps_developer_identity.pem`
$ PORT=4567 bundle exec foreman start
$ heorku create
$ git push heroku master
$ heroku config:add APN_CERTIFICATE_BASE64=`bundle exec rake APN_CERTIFICATE=/path/to/aps_developer_identity.pem`
$ heroku config:add APN_CERTIFICATE=tmp/apple_push_notification.pem
$ curl -XPOST https://yourapp.herokuapp.com/message \
-H 'Content-Type: application/json' \
-d '{
"tokens":["xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx"],
"payload": {
"aps" : {
"alert" : "Yo",
"badge" : 0,
"sound" : "default",
},
"my_data" : "my_string"
}
}'
This code is extracted from Helios by Mattt Thompson.