开发者

Apple push notification sent_at in apn_notification table is null

I use following code with apn_notfications in Ruby

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开发者_如何学Python
notification.sound = true
notification.alert = "foobar"
notification.save

But for some notification in apn_notifications table I got sent_at as nil.

Please tell me why this happen and when sent_at field is updated in Table.

Any help would be highly appreciated.


This is exactly the expected behaviour. You need to run the rake apn:notifications:deliver task to send all unset notifications.

sent_at field will be updated as soons as the rake task manage to send the notification to the Apple server.

Be sure to include apn_on_rails_tasks from your Rakefile.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜