markbates (owner)

Revisions

gist: 154516 Download_button fork
public
Public Clone URL: git://gist.github.com/154516.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
# Create a new device with your iPhone device token:
device = Device.create(:token => '5gxadhy6 6zmtxfl6 5zpbcxmw ez3w7ksf qscpr55t trknkzap 7yyt45sc g6jrw7qz')
 
# Create a new notification to send to the device:
apn = APN::Notification.new
apn.badge = 5
apn.sound = 'my_sound.aiff'
apn.alert = 'Hello!'
apn.device = device
apn.save
 
# Deliver all unsent notifications:
APN::Notification.send_notifications