cfc / apple_push_notification forked from samsoffes/apple_push_notification
- Source
- Commits
- Network (6)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
commit 6c84fef46373ddf55fc6d62c41e8158393157514
tree 12a275233b856282475f1e245bf94b83fd696a70
parent a8ed1a609a8ceb2fa626251ed6cbfc5142aae162
tree 12a275233b856282475f1e245bf94b83fd696a70
parent a8ed1a609a8ceb2fa626251ed6cbfc5142aae162
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
LICENSE | ||
| |
README.markdown | ||
| |
Rakefile | ||
| |
init.rb | ||
| |
install.rb | ||
| |
lib/ | ||
| |
tasks/ | ||
| |
test/ | ||
| |
uninstall.rb |
README.markdown
Apple Push Notification
This plugin helps you use the Apple Push Notification system.
Converting Your Certificate
Once you have the certificate from Apple for your application, export your key and the apple certificate as p12 files. Here is a quick walkthrough on how to do this:
- Click the disclosure arrow next to your certificate in Keychain Access and select the certificate and the key.
- Right click and choose
Export 2 items.... - Choose the p12 format from the drop down and name it
cert.p12.
Now covert the p12 file to a pem file:
$ openssl pkcs12 -in cert.p12 -out apple_push_notification.pem -nodes -clcerts
Put apple_push_notification.pem in config/
Installing
Simply run the following commands to add apple-push-notification as a submodule to your repo, a plugin to your rails app, and install it.
$ cd ~/my_rails_app
$ script/plugin install add git://github.com/samsoffes/apple_push_notification.git
$ rake apn:migrate
Example
Note: the spaces in device_token are optional.
$ ./script/console
>> a = ApplePushNotification.new
>> a.device_token = "XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX"
>> a.badge = 5
>> a.sound = true
>> a.alert = "foobar"
>> a.send_notification
=> nil
Copyright (c) 2009 Fabien Penso. Released under the MIT license. Modified by Sam Soffes.

