Hi,

Try this, i did it same way


>> device = APN::Device.create(:token => "XXXXXXXX XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX")
 >> notification = APN::Notification.new
>> device.id= 'xxxxxxx'
 >> notification.device = device
 >> notification.badge = 5
 >> notification.sound = true
 >> notification.alert = "foobar"
 >> notification.save
   *
I tried the same way in my console.. See APN: Notifications table and the
device id will be in APN: Device table.
*



On 11 July 2010 17:43, Greg Ma <[email protected]> wrote:

> Hi,
> I'm really not sure someone will be able to help me, but I have a
> problem with apn_on_rails.
> When I follow the exemple on the github page I have an error:
>
> >> device = APN::Device.create(:token => "XXXXXXXX XXXXXXXX XXXXXXXX
> XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX")
>  >> notification = APN::Notification.new
>  >> notification.device = device
>  >> notification.badge = 5
>  >> notification.sound = true
>  >> notification.alert = "foobar"
>  >> notification.save
>
>
> My error:
> activeRecord::StatementInvalid: Mysql::Error: Column 'device_id' cannot
> be null: INSERT INTO `apn_notifications` (`custom_properties`,
> `created_at`, `device_language`, `updated_at`, `device_id`, `sent_at`,
> `badge`, `errors_nb`, `sound`, `alert`) VALUES(NULL, '2010-07-11
> 11:22:36', NULL, '2010-07-11 11:22:36', NULL, NULL, 5, 0, 1, 'foobar')
>
> My question is where to I set the device_id ?
> I can't do: device.device_id = XXXXXXXX
>
> Greg
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to