markbates (owner)

Revisions

gist: 179727 Download_button fork
public
Public Clone URL: git://gist.github.com/179727.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
puts "APN::Device.count (Before): #{APN::Device.count}"
puts "APN::Notification.count (Before): #{APN::Notification.count}"
 
device = APN::Device.create(:token => "5gxadhy6 6zmtxfl6 5zpbcxmw ez3w7ksf qscpr55t trknkzap 7yyt45sc g6jrw7qz")
notification = APN::Notification.new
notification.device = device
notification.badge = 5
notification.sound = true
notification.alert = "foobar"
notification.save
 
puts "APN::Device.count (After): #{APN::Device.count}"
puts "APN::Notification.count (After): #{APN::Notification.count}"
 
 
############
# APN::Device.count (Before): 1
# APN::Notification.count (Before): 0
# APN::Device.count (After): 2
# APN::Notification.count (After): 1