apnotic 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/README.md +16 -16
- data/apnotic.gemspec +1 -1
- data/lib/apnotic/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96a81fa7043cdf525821559c6f17f25ac3ed68e5
|
4
|
+
data.tar.gz: ce96f01178be6446a377c432e75dc084ec09eaab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dfd67c994bc476f175425cae6c49c1588b594e874677c13b9ef559711d61dca6d4978aeda4c7c86830c04d70a2220ae568eae8d3f8fb07249b0e022800036e3
|
7
|
+
data.tar.gz: 150029805a257482683b5ce5338baf2e8e75bd24978530ed004e5f28c957d7038029ab9799fed3e1a32e8e558716f01c72285dd1e982d48554db0ede222d6fda
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -34,7 +34,7 @@ require 'apnotic'
|
|
34
34
|
# create a persistent connection
|
35
35
|
connection = Apnotic::Connection.new(cert_path: "apns_certificate.pem", cert_pass: "pass")
|
36
36
|
|
37
|
-
# create a notification for a specific device token
|
37
|
+
# create a notification for a specific device token
|
38
38
|
token = "6c267f26b173cd9595ae2f6702b1ab560371a60e7c8a9e27419bd0fa4a42e58f"
|
39
39
|
|
40
40
|
notification = Apnotic::Notification.new(token)
|
@@ -58,7 +58,7 @@ A practical usage of a Sidekiq / Rescue worker probably has to:
|
|
58
58
|
|
59
59
|
* Use a pool of persistent connections.
|
60
60
|
* Send a push notification.
|
61
|
-
* Remove a device with an invalid token.
|
61
|
+
* Remove a device with an invalid token.
|
62
62
|
|
63
63
|
An example of a Sidekiq worker with such features follows. This presumes a Rails environment, and a model `Device`.
|
64
64
|
|
@@ -116,20 +116,20 @@ It is also possible to create a connection that points to the Apple Development
|
|
116
116
|
Apnotic::Connection.development(options)
|
117
117
|
```
|
118
118
|
|
119
|
-
> The concepts of PRODUCTION and DEVELOPMENT are different from what they used to be in previous specifications. Anything built directly from XCode and loaded on your phone will have the app generate DEVELOPMENT tokens, while everything else (TestFlight, Apple Store, HockeyApp, ...) will be considered as PRODUCTION environment.
|
119
|
+
> The concepts of PRODUCTION and DEVELOPMENT are different from what they used to be in previous specifications. Anything built directly from XCode and loaded on your phone will have the app generate DEVELOPMENT tokens, while everything else (TestFlight, Apple Store, HockeyApp, ...) will be considered as PRODUCTION environment.
|
120
120
|
|
121
121
|
#### Methods
|
122
122
|
|
123
123
|
* **uri** → **`URI`**
|
124
|
-
|
124
|
+
|
125
125
|
Returns the URI of the APNS endpoint.
|
126
126
|
|
127
127
|
* **cert_path** → **`string`**
|
128
|
-
|
128
|
+
|
129
129
|
Returns the path to the certificate
|
130
|
-
|
130
|
+
|
131
131
|
* **push(notification, timeout=30)** → **`Apnotic::Response` or `nil`**
|
132
|
-
|
132
|
+
|
133
133
|
Sends a notification. Returns `nil` in case a timeout occurs.
|
134
134
|
|
135
135
|
|
@@ -200,21 +200,21 @@ The response to a call to `connection.push`.
|
|
200
200
|
|
201
201
|
#### Methods
|
202
202
|
|
203
|
+
* **ok?** → **`boolean`**
|
204
|
+
|
205
|
+
Returns if the push was successful.
|
206
|
+
|
203
207
|
* **headers** → **`hash`**
|
204
|
-
|
208
|
+
|
205
209
|
Returns a Hash containing the Headers of the response.
|
206
210
|
|
207
211
|
* **status** → **`string`**
|
208
|
-
|
212
|
+
|
209
213
|
Returns the status code.
|
210
214
|
|
211
215
|
* **body** → **`hash` or `string`**
|
212
|
-
|
213
|
-
Returns the body of the response in Hash format if a valid JSON was returned, otherwise just the RAW body.
|
214
216
|
|
215
|
-
|
216
|
-
|
217
|
-
Returns if the push was successful.
|
217
|
+
Returns the body of the response in Hash format if a valid JSON was returned, otherwise just the RAW body.
|
218
218
|
|
219
219
|
|
220
220
|
## Getting Your APNs Certificate
|
@@ -223,8 +223,8 @@ The response to a call to `connection.push`.
|
|
223
223
|
|
224
224
|
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:
|
225
225
|
|
226
|
-
1. Click the disclosure arrow next to your certificate in Keychain Access and select the certificate and the key.
|
227
|
-
2. Right click and choose `Export 2 items…`.
|
226
|
+
1. Click the disclosure arrow next to your certificate in Keychain Access and select the certificate and the key.
|
227
|
+
2. Right click and choose `Export 2 items…`.
|
228
228
|
3. Choose the p12 format from the drop down and name it `cert.p12`.
|
229
229
|
|
230
230
|
Optionally, you may covert the p12 file to a pem file (this step is optional because Apnotic natively supports p12 files):
|
data/apnotic.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "net-http2", "~> 0.
|
21
|
+
spec.add_dependency "net-http2", "~> 0.10.0"
|
22
22
|
spec.add_dependency "connection_pool", "~> 2.0"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
data/lib/apnotic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apnotic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Ostinelli
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-http2
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.10.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.10.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: connection_pool
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|