Skip to content
Newer
Older
100644 46 lines (31 sloc) 1.44 KB
85e318a @markbates Added tests for the apple_hash method
markbates authored
1 Apple Push Notification
2 =====================
3
4 This plugin helps you use the Apple Push Notification system.
5
6 Converting Your Certificate
7 ---------------------------
8
9 Once you have the certificate from Apple for your application, export your key
10 and the apple certificate as p12 files. Here is a quick walkthrough on how to do this:
11
12 1. Click the disclosure arrow next to your certificate in Keychain Access and select the certificate and the key.
13 2. Right click and choose `Export 2 items...`.
14 3. Choose the p12 format from the drop down and name it `cert.p12`.
15
16 Now covert the p12 file to a pem file:
17
18 $ openssl pkcs12 -in cert.p12 -out apple_push_notification.pem -nodes -clcerts
19
20 Put `apple_push_notification.pem` in config/
21
22 Installing
23 ----------
24
25 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.
26
27 $ cd ~/my_rails_app
28 $ script/plugin install git://github.com/samsoffes/apple_push_notification.git
29 $ rake apn:migrate
30
31 Example
32 -------
33
34 *Note: the spaces in `device_token` are optional.*
35
36 $ ./script/console
37 >> a = ApplePushNotification.new
38 >> a.device_token = "XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX"
39 >> a.badge = 5
40 >> a.sound = true
41 >> a.alert = "foobar"
42 >> a.send_notification
43 => nil
44
45 Copyright (c) 2009 Fabien Penso. Released under the MIT license. Modified by [Sam Soffes](http://samsoff.es).
Something went wrong with that request. Please try again.