Skip to content
This repository has been archived by the owner on Mar 9, 2018. It is now read-only.

Upgrading to 3.0

ileitch edited this page Dec 4, 2012 · 9 revisions

3.0 is a backwards incompatible release that adds supports for GCM (Google Cloud Messaging).

  • App and Notification classes are now namespaced.
  • App and Notification now also use ActiveRecord associations rather than string keys.

Upgrade Steps

Backup your development database if it's not easily regenerated. 3.0 adds a migration that alters schema.

  • Add gem 'rapns', '3.0.0.beta.1' to your Gemfile.
  • rails g rapns to generate upgrade migration.
  • rake db:migrate

New API

app = Rapns::Apns::App.new
app.name = 'My iOS App'
app.certificate = '...'
app.environment = 'development'
app.save!

n = Rapns::Apns::Notification.new
n.app = app
n.device_token = '...'
n.alert = '...'
n.save!