You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-26
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ This library is a work in progress and it's API is subject to change till `v0.1`
11
11
1. Add apns to your list of dependencies in mix.exs:
12
12
13
13
def deps do
14
-
[{:apns, "== 0.0.6"}]
14
+
[{:apns, "== 0.0.7"}]
15
15
end
16
16
17
17
2. Ensure apns is started before your application:
@@ -20,38 +20,62 @@ This library is a work in progress and it's API is subject to change till `v0.1`
20
20
[applications: [:apns]]
21
21
end
22
22
23
-
## Using
23
+
## Usage
24
24
25
-
1.Config the APNS app
25
+
Config the APNS app and define pools
26
26
27
-
You can provide config as `key: value` to use the same value for both envs or `key: [dev: dev_value, prod: prod_value]` to use different values for :dev and :prod env
28
-
29
-
- Required APNS config will only include paths to certificates:
30
-
```elixir
31
-
config :apns,
32
-
certfile: [
33
-
dev:"/path/to/dev_cert.pem",
34
-
prod:"/path/to/prod_cert.pem"
35
-
]
36
-
```
37
-
- Optional config is the following:
38
27
```elixir
39
28
config :apns,
29
+
# Here goes "global" config applied as default to all pools started if not overwritten by pool-specific value
40
30
callback_module:APNS.Callback,
41
-
keyfile:nil,
42
-
cert_password:nil,
43
-
timeout:30000,
44
-
feedback_timeout:1200,
45
-
reconnect_after:1000
31
+
timeout:30,
32
+
feedback_interval:1200,
33
+
reconnect_after:1000,
34
+
support_old_ios:true,
35
+
# Here are pools configs. Any value from "global" config can be overwritten in any single pool config
36
+
pools: [
37
+
# app1_dev_pool is the pool_name
38
+
app1_dev_pool: [
39
+
env::dev,push server)
40
+
pool_size:10,
41
+
pool_max_overflow:5,
42
+
# and this is overwritten config key
43
+
certfile:"/path/to/app1_dev.pem"
44
+
],
45
+
app1_prod_pool: [
46
+
env::prod,
47
+
certfile:"/path/to/app1_prod.pem",
48
+
pool_size:100,
49
+
pool_max_overflow:50
50
+
],
51
+
]
46
52
```
47
53
48
-
2. Start a :dev (for Apple sandbox server) or :prod (for Apple prod server) worker:
0 commit comments