maia 4.0.1 → 4.0.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/lib/maia/fcm/service.rb +3 -7
- data/lib/maia/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 025ce2db40e0a38154ef906b6ca0754393f7daf40e592c4a0783542ab9aa8c9d
|
4
|
+
data.tar.gz: 649ad5dcb5d5f6fedd0e58b3d148118027704a91c022d8a1030caf56366c74e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f6101e09a971a822c4869b81ba632ff347ddb29b0ac4867c15f3d9d4feca440d2e8f60ddf13b91e9cd29997b34e15d25ff0276213bf0a3dde0a4dfe0669eeca
|
7
|
+
data.tar.gz: 3bc0259037b93eba1aa193a665d8d8e6592a16164320bf6f01bdd6183967bbf31534dc5edb43ca7f87d81559e58338cc61a7d79317dc2bb68dea634df9369866
|
data/lib/maia/fcm/service.rb
CHANGED
@@ -11,13 +11,13 @@ 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_all(notification, tokens)
|
15
|
+
responses << deliver_all(notification, "/topics/#{topic}") if topic
|
16
16
|
responses
|
17
17
|
end
|
18
18
|
|
19
19
|
private
|
20
|
-
def
|
20
|
+
def deliver_all(notification, tokens)
|
21
21
|
batch(tokens).map do |batch|
|
22
22
|
if batch.one?
|
23
23
|
unicast notification, batch.first
|
@@ -35,10 +35,6 @@ 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
|
-
|
42
38
|
def deliver!(notification, recipients, params = {})
|
43
39
|
payload = notification.to_h.merge params
|
44
40
|
Response.new @connection.write(payload), Array(recipients)
|
data/lib/maia/version.rb
CHANGED