Skip to content

Instantly share code, notes, and snippets.

@moosan63
Created September 16, 2013 08:31
Show Gist options
  • Save moosan63/6577999 to your computer and use it in GitHub Desktop.
Save moosan63/6577999 to your computer and use it in GitHub Desktop.
gem houstonのpush試作
require 'houston'
content_type :json, :charset => 'utf-8'
APN = Houston::Client.development
APN.certificate = File.read("./your/cert-file/path")
token = "<device-token>"
notification = Houston::Notification.new(device: token)
notification.alert = "Hello, World!"
notification.badge = 57
notification.sound = "sosumi.aiff"
notification.content_available = true
notification.custom_data = {foo: "bar"}
APN.push(notification)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment