maia 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/controllers/concerns/maia/controller.rb +1 -1
- data/lib/maia/fcm/service.rb +11 -7
- data/lib/maia/version.rb +1 -1
- metadata +3 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 34b80024536d89e766bb44b64eaa13a75cdb7d63574b465ee5a0ea30749c09ee
|
4
|
+
data.tar.gz: 33bc3caff54507d8c67381c127cbb0d55a0c11922fe12324f2be4cde0dcea65b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 500a847f93b858a4741723873e3f8f8c12c12333b4433bd438c0294bdad713acd8633649f79966a9ef6f14816a176c4e914774e287c516dc375b70743e75dba1
|
7
|
+
data.tar.gz: 8e4f7e73d51e2f30f64500d4cbd9052d15e2247c31fc71561debccec8d6fcfcb14f6f0ed5b54d01f7871635d4283ed2c824c73eef02f36bb11dae0555ced915f
|
data/lib/maia/fcm/service.rb
CHANGED
@@ -11,18 +11,18 @@ module Maia
|
|
11
11
|
|
12
12
|
def deliver(notification, *tokens, topic: nil)
|
13
13
|
responses = ResponseCollection.new notification
|
14
|
-
responses <<
|
15
|
-
responses <<
|
14
|
+
responses << deliver_to_tokens(notification, tokens)
|
15
|
+
responses << deliver_to_topic(notification, topic) if topic
|
16
16
|
responses
|
17
17
|
end
|
18
18
|
|
19
19
|
private
|
20
|
-
def
|
21
|
-
batch(
|
22
|
-
if batch.
|
23
|
-
multicast notification, batch
|
24
|
-
elsif batch.one?
|
20
|
+
def deliver_to_tokens(notification, tokens)
|
21
|
+
batch(tokens).map do |batch|
|
22
|
+
if batch.one?
|
25
23
|
unicast notification, batch.first
|
24
|
+
elsif batch.many?
|
25
|
+
multicast notification, batch
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -35,6 +35,10 @@ module Maia
|
|
35
35
|
deliver! notification, recipients, registration_ids: recipients
|
36
36
|
end
|
37
37
|
|
38
|
+
def deliver_to_topic(notification, topic)
|
39
|
+
deliver! notification, [], topic: topic
|
40
|
+
end
|
41
|
+
|
38
42
|
def deliver!(notification, recipients, params = {})
|
39
43
|
payload = notification.to_h.merge params
|
40
44
|
Response.new @connection.write(payload), Array(recipients)
|
data/lib/maia/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Logan Serman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -92,48 +92,6 @@ dependencies:
|
|
92
92
|
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '0'
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
|
-
name: capybara
|
97
|
-
requirement: !ruby/object:Gem::Requirement
|
98
|
-
requirements:
|
99
|
-
- - ">="
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '0'
|
102
|
-
type: :development
|
103
|
-
prerelease: false
|
104
|
-
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
requirements:
|
106
|
-
- - ">="
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
version: '0'
|
109
|
-
- !ruby/object:Gem::Dependency
|
110
|
-
name: capybara-webkit
|
111
|
-
requirement: !ruby/object:Gem::Requirement
|
112
|
-
requirements:
|
113
|
-
- - ">="
|
114
|
-
- !ruby/object:Gem::Version
|
115
|
-
version: '0'
|
116
|
-
type: :development
|
117
|
-
prerelease: false
|
118
|
-
version_requirements: !ruby/object:Gem::Requirement
|
119
|
-
requirements:
|
120
|
-
- - ">="
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
version: '0'
|
123
|
-
- !ruby/object:Gem::Dependency
|
124
|
-
name: launchy
|
125
|
-
requirement: !ruby/object:Gem::Requirement
|
126
|
-
requirements:
|
127
|
-
- - ">="
|
128
|
-
- !ruby/object:Gem::Version
|
129
|
-
version: '0'
|
130
|
-
type: :development
|
131
|
-
prerelease: false
|
132
|
-
version_requirements: !ruby/object:Gem::Requirement
|
133
|
-
requirements:
|
134
|
-
- - ">="
|
135
|
-
- !ruby/object:Gem::Version
|
136
|
-
version: '0'
|
137
95
|
- !ruby/object:Gem::Dependency
|
138
96
|
name: webmock
|
139
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -216,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
174
|
version: '0'
|
217
175
|
requirements: []
|
218
176
|
rubyforge_project:
|
219
|
-
rubygems_version: 2.
|
177
|
+
rubygems_version: 2.7.7
|
220
178
|
signing_key:
|
221
179
|
specification_version: 4
|
222
180
|
summary: Manage device tokens and push messaging with Rails and FCM.
|