Skip to content

Instantly share code, notes, and snippets.

@brcosm
brcosm / apns.rb
Created September 13, 2011 02:41
Ruby Apple Push Notification Example
require 'openssl'
require 'socket'
require 'rubygems'
require 'json'
# Takes json as an input and sends data to APNS over SSL
APNS_HOST = 'gateway.sandbox.push.apple.com'
APNS_PORT = 2195
APNS_CERT_FILE_PATH = 'MyCert.pem'