notifiable-apns-apnotic 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/notifiable/apns/apnotic/async.rb +18 -7
- data/lib/notifiable/apns/apnotic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e5fb0a493afb44c6ea1a369055cb892b23013b2f2cda940be1f4bb2358371d63
|
|
4
|
+
data.tar.gz: ff37f0058a0ba88ec7d25628f9a6935a918f5262d5523f1e2ae688063be4bfb0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 57b186f9c355a675dff545469a498053ffe62fff7ca0ecfac3a8a8befc95f8f156d9bde6c05fbd67f6813919397f659c99db348a02747ce6680c13f88296db67
|
|
7
|
+
data.tar.gz: c5d428433a78ece29484256722a037361f8b0712ae1d8dccddbfb929e4f31975b5b2aaeac8550ca297bbc63fcb37e51b144cb8ddeb2e6fe874c846836c110e91
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
notifiable-apns-apnotic (0.3.
|
|
4
|
+
notifiable-apns-apnotic (0.3.2)
|
|
5
5
|
apnotic (~> 1.4.1)
|
|
6
6
|
grocer (~> 0.7.1)
|
|
7
7
|
notifiable-core (>= 0.1.3)
|
|
@@ -15,7 +15,7 @@ GEM
|
|
|
15
15
|
activemodel (= 5.2.1)
|
|
16
16
|
activesupport (= 5.2.1)
|
|
17
17
|
arel (>= 9.0)
|
|
18
|
-
activerecord-import (0.
|
|
18
|
+
activerecord-import (0.26.0)
|
|
19
19
|
activerecord (>= 3.2)
|
|
20
20
|
activesupport (5.2.1)
|
|
21
21
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
@@ -40,7 +40,7 @@ GEM
|
|
|
40
40
|
minitest (5.11.3)
|
|
41
41
|
net-http2 (0.18.0)
|
|
42
42
|
http-2 (= 0.9.0)
|
|
43
|
-
notifiable-core (0.2.
|
|
43
|
+
notifiable-core (0.2.3)
|
|
44
44
|
activerecord
|
|
45
45
|
activerecord-import
|
|
46
46
|
pg (1.1.0)
|
|
@@ -21,15 +21,22 @@ module Notifiable
|
|
|
21
21
|
raise "bundle_id missing" if bundle_id.nil?
|
|
22
22
|
|
|
23
23
|
apnotic_notification = build_notification(device, notification)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
apnotic_enqueue(apnotic_notification, device)
|
|
25
|
+
|
|
26
|
+
rescue SocketError => e
|
|
27
|
+
# create a new connection and retry
|
|
28
|
+
close_connection
|
|
29
|
+
apnotic_enqueue(apnotic_notification, device)
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
private
|
|
34
|
+
def apnotic_enqueue(apnotic_notification, device)
|
|
35
|
+
push = connection.prepare_push(apnotic_notification)
|
|
36
|
+
push.on(:response) {|response| process_response(response, device) }
|
|
37
|
+
connection.push_async(push)
|
|
38
|
+
end
|
|
39
|
+
|
|
33
40
|
def url
|
|
34
41
|
self.sandbox? ? ::Apnotic::APPLE_DEVELOPMENT_SERVER_URL : ::Apnotic::APPLE_PRODUCTION_SERVER_URL
|
|
35
42
|
end
|
|
@@ -43,10 +50,14 @@ module Notifiable
|
|
|
43
50
|
end
|
|
44
51
|
end
|
|
45
52
|
|
|
46
|
-
def
|
|
53
|
+
def close_connection
|
|
47
54
|
connection.join
|
|
48
55
|
connection.close
|
|
49
|
-
@connection = nil
|
|
56
|
+
@connection = nil
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def flush
|
|
60
|
+
close_connection
|
|
50
61
|
process_feedback
|
|
51
62
|
end
|
|
52
63
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: notifiable-apns-apnotic
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Brooke-Smith
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-10-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: notifiable-core
|