PRX / apn_on_rails

Apple Push Notifications on Rails
http://rubydoc.info/github/PRX/apn_on_rails/master/frames
MIT License
538 stars 156 forks source link

Error creating an APN::Device #23

Closed cwoloszynski closed 13 years ago

cwoloszynski commented 13 years ago

I am new to this GEM, so please excuse the NEWBIE questions.

I am using the 0.4.1 version. I cannot seem to get a proper ID assigned to any APN::Device I create. I've whittled the problem down to the following steps in the console.

I don't understand what I did that would cause the device to have no ID and fail on the save.

Any thoughts?

poweruser$ script/console Loading development environment (Rails 2.3.5) console> require 'apn_on_rails' => []

console> app = APN::App.create(:apn_dev_cert => "DEV", :apn_prod_cert => "PROD") => #<APN::App id: 2, apn_dev_cert: "DEV", apn_prod_cert: "PROD", created_at: "2011-01-23 14:48:52", updated_at: "2011-01-23 14:48:52">

console> app.save => true

console> device = APN::Device.create(:token => 'aaaa', :app_id => app.id) => #<APN::Device id: nil, token: "aaaa", created_at: nil, updated_at: nil, last_registered_at: nil, app_id: 2>

console> device.save => false

cwoloszynski commented 13 years ago

Nevermind. I figured it out. The 'token' must be 8 blocks of 8 alphanumeric digits ALL IN LOWER CASE.

I missed the last part and was trying to use Xs instead of 'x's.