Skip to content

Commit 123044d

Browse files
author
Nolan Warner
committedSep 30, 2015
Added houston push generator script
1 parent 566aca6 commit 123044d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
 

‎xcode-tools/houston_push.rb

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
require 'houston'
2+
3+
# Environment variables are automatically read, or can be overridden by any specified options. You can also
4+
# conveniently use `Houston::Client.development` or `Houston::Client.production`.
5+
APN = Houston::Client.development
6+
APN.certificate = File.read("/Users/renrawnalon/workspace/ElevenNines/certificates/development_jp.co.elevennines.Willbe.beta.pem")
7+
8+
# An example of the token sent back when a device registers for notifications
9+
token = "<7e315ad1 34e54030 36604a33 47833a2b 14e35883 b6c4664d 7b180e72 bd1b9ac2>"
10+
11+
# Create a notification that alerts a message to the user, plays a sound, and sets the badge on the app
12+
notification = Houston::Notification.new(device: token)
13+
notification.alert = "Hello, World!"
14+
15+
# Notifications can also change the badge count, have a custom sound, have a category identifier, indicate available Newsstand content, or pass along arbitrary data.
16+
notification.badge = 57
17+
notification.sound = "sosumi.aiff"
18+
notification.category = "INVITE_CATEGORY"
19+
notification.content_available = true
20+
notification.custom_data = {foo: "bar"}
21+
22+
# And... sent! That's all it takes.
23+
APN.push(notification)

0 commit comments

Comments
 (0)
Please sign in to comment.