google-api-fcm 0.0.1 → 0.1.0
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/google/apis/messages/classes.rb +12 -3
- data/lib/google/apis/messages/representations.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b18c9a80aa74c0d84ef9122db088c44376997f8
|
4
|
+
data.tar.gz: 928de98bc4e05954c0f8f677a6565e90dc13a07a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daebfd873171266fefdddfae7f6f8fccae129f3cc90ae8543c2dddb464235010df6e5fce305e9ff87e4d619a01d989fb2dfbc5a7399d9e49f781fc822aa61e6f
|
7
|
+
data.tar.gz: 465dee724fb85f6b6d4a4f62ecbd30953b27385ffd7a0e24b28ec042457d3854b93480c74cde0e0a052224abe74f3ad9bfc21c8a528a3fe0cf8ee0deebe119bd
|
@@ -18,9 +18,9 @@ module Google
|
|
18
18
|
|
19
19
|
end
|
20
20
|
|
21
|
-
def initialize_build(topic:, title:, body:)
|
21
|
+
def initialize_build(topic:, title:, body:, payload: nil)
|
22
22
|
notification = Notification.new(title: title, body: body)
|
23
|
-
@message_object = MessageObject.new(topic: topic, notification: notification)
|
23
|
+
@message_object = MessageObject.new(topic: topic, notification: notification, data: payload)
|
24
24
|
end
|
25
25
|
|
26
26
|
def update!(**args)
|
@@ -33,6 +33,7 @@ module Google
|
|
33
33
|
|
34
34
|
attr_accessor :topic
|
35
35
|
attr_accessor :notification
|
36
|
+
attr_accessor :data
|
36
37
|
|
37
38
|
def initialize(**args)
|
38
39
|
update!(**args)
|
@@ -42,6 +43,14 @@ module Google
|
|
42
43
|
def update!(**args)
|
43
44
|
@topic = args[:topic] if args.key?(:topic)
|
44
45
|
@notification = args[:notification] if args.key?(:notification)
|
46
|
+
if args.key?(:data) && args[:data].is_a?(Hash)
|
47
|
+
data = {}
|
48
|
+
args[:data].each do |key, value|
|
49
|
+
data[key.to_s] = value.to_s
|
50
|
+
end
|
51
|
+
|
52
|
+
@data = data
|
53
|
+
end
|
45
54
|
end
|
46
55
|
end
|
47
56
|
|
@@ -63,4 +72,4 @@ module Google
|
|
63
72
|
end
|
64
73
|
end
|
65
74
|
end
|
66
|
-
end
|
75
|
+
end
|
@@ -30,6 +30,7 @@ module Google
|
|
30
30
|
class Representation < Google::Apis::Core::JsonRepresentation
|
31
31
|
property :topic, as: 'topic'
|
32
32
|
property :notification, as: 'notification', class: Google::Apis::Messages::Notification, decorator: Google::Apis::Messages::Notification::Representation
|
33
|
+
property :data, as: 'data'
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
@@ -41,4 +42,4 @@ module Google
|
|
41
42
|
end
|
42
43
|
end
|
43
44
|
end
|
44
|
-
end
|
45
|
+
end
|
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.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Krigouzov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-api-client
|