maia 4.0.1 → 4.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34b80024536d89e766bb44b64eaa13a75cdb7d63574b465ee5a0ea30749c09ee
4
- data.tar.gz: 33bc3caff54507d8c67381c127cbb0d55a0c11922fe12324f2be4cde0dcea65b
3
+ metadata.gz: 025ce2db40e0a38154ef906b6ca0754393f7daf40e592c4a0783542ab9aa8c9d
4
+ data.tar.gz: 649ad5dcb5d5f6fedd0e58b3d148118027704a91c022d8a1030caf56366c74e7
5
5
  SHA512:
6
- metadata.gz: 500a847f93b858a4741723873e3f8f8c12c12333b4433bd438c0294bdad713acd8633649f79966a9ef6f14816a176c4e914774e287c516dc375b70743e75dba1
7
- data.tar.gz: 8e4f7e73d51e2f30f64500d4cbd9052d15e2247c31fc71561debccec8d6fcfcb14f6f0ed5b54d01f7871635d4283ed2c824c73eef02f36bb11dae0555ced915f
6
+ metadata.gz: 6f6101e09a971a822c4869b81ba632ff347ddb29b0ac4867c15f3d9d4feca440d2e8f60ddf13b91e9cd29997b34e15d25ff0276213bf0a3dde0a4dfe0669eeca
7
+ data.tar.gz: 3bc0259037b93eba1aa193a665d8d8e6592a16164320bf6f01bdd6183967bbf31534dc5edb43ca7f87d81559e58338cc61a7d79317dc2bb68dea634df9369866
@@ -11,13 +11,13 @@ module Maia
11
11
 
12
12
  def deliver(notification, *tokens, topic: nil)
13
13
  responses = ResponseCollection.new notification
14
- responses << deliver_to_tokens(notification, tokens)
15
- responses << deliver_to_topic(notification, topic) if topic
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 deliver_to_tokens(notification, tokens)
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)
@@ -1,3 +1,3 @@
1
1
  module Maia
2
- VERSION = '4.0.1'.freeze
2
+ VERSION = '4.0.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maia
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Logan Serman