google-api-fcm 0.1.5 → 0.1.6

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: c1d5f0da09a286f9c886cb79f4fee7d5edc4c4f8884d6292f4ae396d106fa845
4
- data.tar.gz: 2cdfd154307d190f42d886e56aace239b2771129007686c465c0c786f181789a
3
+ metadata.gz: ff91dab0d94d58d766a0ba5d18174bcf411d7d78fcde179663c91f165cff18d9
4
+ data.tar.gz: c3a88b2b4effe8b3e461c9e696bc9a7a2d934a04e8ae7ec32e6c97a160f28d9c
5
5
  SHA512:
6
- metadata.gz: e54e71a9017c6964ce9e066cee26724bab97a270a19ec0613b1dd5d0636bb391bb094423fff2a62e790fceab3e218b86a0abf34f441746ec94ab81107f3eb02f
7
- data.tar.gz: 7bb2b7f8624134dae56ada2e85564716e57c408f1b75b1d59c34ba80d88ccf52e6b7f99bbffcc82ed6f425f97ce9f71ee1fcfe591b74966793cabdee7fce9655
6
+ metadata.gz: 44d9d6c1946eb14d21f84145d9e425eafbfbb090a434fb2e4aea761de46aa60d3398d0be07add16c0af93e8b50bc4c4217a2b7ff8fb0a69a2e9906b59a69123c
7
+ data.tar.gz: 067a3ee396868e0996e6589e5029f6f3eb6abb0d6ce544aa1497243f4cac4dba4041134917cd4f8bc42342a2c838b85fe076330deb6ffdd3adf3911b5a415fcf
@@ -11,6 +11,10 @@ module Google
11
11
  end
12
12
 
13
13
  def initialize_build(**args)
14
+ if args[:token] && args[:topic]
15
+ raise ArgumentError, "Arguments :token and :topic can't be used together"
16
+ end
17
+
14
18
  if args[:notification]
15
19
  notification = Notification.new(
16
20
  title: args[:notification][:title],
@@ -20,6 +24,7 @@ module Google
20
24
 
21
25
  message_object_args = {
22
26
  topic: args[:topic],
27
+ token: args[:token],
23
28
  data: args[:payload]
24
29
  }
25
30
 
@@ -59,6 +64,7 @@ module Google
59
64
  include Google::Apis::Core::Hashable
60
65
 
61
66
  attr_accessor :topic
67
+ attr_accessor :token
62
68
  attr_accessor :notification
63
69
  attr_accessor :data
64
70
  attr_accessor :android
@@ -72,6 +78,7 @@ module Google
72
78
  # Update properties of this object
73
79
  def update!(**args)
74
80
  @topic = args[:topic] if args.key?(:topic)
81
+ @token = args[:token] if args.key?(:token)
75
82
  @notification = args[:notification] if args.key?(:notification)
76
83
  if args.key?(:data) && args[:data].is_a?(Hash)
77
84
  @data = { 'payload' => JSON.dump(args[:data]) }
@@ -34,6 +34,7 @@ module Google
34
34
  # @private
35
35
  class Representation < Google::Apis::Core::JsonRepresentation
36
36
  property :topic, as: 'topic'
37
+ property :token, as: 'token'
37
38
  property :data, as: 'data'
38
39
  property :notification, as: 'notification',
39
40
  class: Google::Apis::Messages::Notification,
@@ -35,6 +35,8 @@ module Google
35
35
  execute_or_queue_command(command, &block)
36
36
  end
37
37
 
38
+ alias notify notify_topic
39
+
38
40
  protected
39
41
 
40
42
  def apply_command_defaults(command)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-api-fcm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Krigouzov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-29 00:00:00.000000000 Z
11
+ date: 2019-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client