Skip to content
This repository has been archived by the owner on Mar 9, 2018. It is now read-only.
Ian Leitch edited this page Jun 30, 2013 · 15 revisions

This isn't an exhaustive guide to Heroku, I assume your Rails app is already deployed there!

Install rapns

echo 'gem "rapns"' >> Gemfile
bundle
rails g rapns
echo 'rapns: bundle exec rapns $RACK_ENV -f' >> Procfile
git add -A
git commit -am "Adding rapns."
git push heroku master
heroku run rake db:migrate

rapns is now installed, but we need to create an Rapns::App before we start it.

$ heroku run console
Running console attached to terminal... up, run.1
Loading production environment (Rails 3.2.6)
>> app = Rapns::Apns::App.new
>> app.name = "my_app"
>> app.environment = "production" # APNs environment.
>> app.certificate = File.read("/path/to/production.pem")
>> app.save!

Start rapns

heroku scale rapns=1

Check it's running with heroku ps and heroku logs.

NOTE: It is important you only run a single instance of rapns. More than one will likely result in notifications being sent more than once.