Skip to content

Instantly share code, notes, and snippets.

@mariovisic
Created May 11, 2011 05:30
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mariovisic/965976 to your computer and use it in GitHub Desktop.
Save mariovisic/965976 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
require 'rubygems'
require 'apn'
require 'apn/sender_daemon'
APN::SenderDaemon.new(ARGV).daemonize
gem 'apn_sender', :require => 'apn'
gem 'daemons'
# notify(token, options)
APN.notify('FE6648........', :alert => 'New Message', :badge => 4, :sound => true, :other_information => 'value')
script/apn_sender --environment=development --verbose start
@ender3
Copy link

ender3 commented May 7, 2012

I don't believe that the script will work as presented. Look at the fork by jaygooby for the full script.

@mariovisic
Copy link
Author

Thanks, have updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment