google-api-fcm 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 765556ff5f9e71cf5e7153d95eef8db4caa71a4a
4
- data.tar.gz: 93fc4304c7c1dad9122c41f5fc1d95406da6bda1
3
+ metadata.gz: de462d71bfc2bb275f6a41f651a1144d075f51ba
4
+ data.tar.gz: de2e5141a1cef3e11410870656f077a52d195c4b
5
5
  SHA512:
6
- metadata.gz: 3d1345dc8049f93178ee0f82e96cc2cd8a551b44bd26e90ec4a5b802f59df828db91a0d3063690f4e23dc5b06b2e9800d0fc762ed6399e14de884f5f279bee10
7
- data.tar.gz: fbf2d2f02def69930942b9e7751acd33396da058aa93d9e06ab16d1debb880e447b77600f3ad7cdb8213a7d48b7d8902feba0e1efd22b643a2fae07120089192
6
+ metadata.gz: 81ee3760665a8264b509c8952ea571f8484e8d1d9c4209cf0ca354df799f8f2f9c592eed7fd46c00c77fb7dfb93dd7b5d58ac87c83a2980ef5c4bdcb1399a258
7
+ data.tar.gz: 47c79942eeb959d85564b4bec8c5f200ee9e960be1023eea37d89d481db728e2c9321fef149d439772aeba90c87609893bf0de836d6da69c7588477f127d4895
@@ -27,8 +27,16 @@ module Google
27
27
  message_object_args[:notification] = notification
28
28
  end
29
29
 
30
- if args.key?(:webpush) && args[:webpush][:icon]
31
- message_object_args[:webpush] = Webpush.new(args[:webpush])
30
+ if args.key?(:android)
31
+ message_object_args[:android] = args[:android]
32
+ end
33
+
34
+ if args.key?(:apns)
35
+ message_object_args[:apns] = args[:apns]
36
+ end
37
+
38
+ if args.key?(:webpush)
39
+ message_object_args[:webpush] = args[:webpush]
32
40
  end
33
41
 
34
42
  @message_object = MessageObject.new(message_object_args)
@@ -49,6 +57,8 @@ module Google
49
57
  attr_accessor :topic
50
58
  attr_accessor :notification
51
59
  attr_accessor :data
60
+ attr_accessor :android
61
+ attr_accessor :apns
52
62
  attr_accessor :webpush
53
63
 
54
64
  def initialize(**args)
@@ -62,6 +72,9 @@ module Google
62
72
  if args.key?(:data) && args[:data].is_a?(Hash)
63
73
  @data = { 'payload' => JSON.dump(args[:data]) }
64
74
  end
75
+
76
+ @android = args[:android] if args.key?(:android)
77
+ @apns = args[:apns] if args.key?(:apns)
65
78
  @webpush = args[:webpush] if args.key?(:webpush)
66
79
  end
67
80
  end
@@ -83,22 +96,6 @@ module Google
83
96
  end
84
97
  end
85
98
 
86
- class Webpush
87
- include Google::Apis::Core::Hashable
88
-
89
- attr_accessor :headers
90
- attr_accessor :notification
91
-
92
- def initialize(**args)
93
- update!(**args)
94
- end
95
-
96
- def update!(**args)
97
- @headers = args[:headers] if args.key?(:headers)
98
- @notification = WebNotification.new(icon: args[:icon])
99
- end
100
- end
101
-
102
99
  class WebNotification
103
100
  include Google::Apis::Core::Hashable
104
101
 
@@ -16,11 +16,6 @@ module Google
16
16
  include Google::Apis::Core::JsonObjectSupport
17
17
  end
18
18
 
19
- class Webpush
20
- class Representation < Google::Apis::Core::JsonRepresentation; end
21
- include Google::Apis::Core::JsonObjectSupport
22
- end
23
-
24
19
  class WebNotification
25
20
  class Representation < Google::Apis::Core::JsonRepresentation; end
26
21
  include Google::Apis::Core::JsonObjectSupport
@@ -43,9 +38,9 @@ module Google
43
38
  property :notification, as: 'notification',
44
39
  class: Google::Apis::Messages::Notification,
45
40
  decorator: Google::Apis::Messages::Notification::Representation
46
- property :webpush, as: 'webpush',
47
- class: Google::Apis::Messages::Webpush,
48
- decorator: Google::Apis::Messages::Webpush::Representation
41
+ hash :android, as: 'android'
42
+ hash :apns, as: 'apns'
43
+ hash :webpush, as: 'webpush'
49
44
  end
50
45
  end
51
46
 
@@ -55,21 +50,6 @@ module Google
55
50
  property :body, as: 'body'
56
51
  end
57
52
  end
58
-
59
- class Webpush
60
- class Representation < Google::Apis::Core::JsonRepresentation
61
- property :headers, as: 'headers'
62
- property :notification, as: 'notification',
63
- class: Google::Apis::Messages::WebNotification,
64
- decorator: Google::Apis::Messages::WebNotification::Representation
65
- end
66
- end
67
-
68
- class WebNotification
69
- class Representation < Google::Apis::Core::JsonRepresentation
70
- property :icon, as: 'icon'
71
- end
72
- end
73
53
  end
74
54
  end
75
55
  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.1.2
4
+ version: 0.1.3
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-01-05 00:00:00.000000000 Z
11
+ date: 2018-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client