pushr-fcm 1.0.0.pre → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pushr-fcm/version.rb +1 -1
- data/lib/pushr/daemon/fcm_support/connection_fcm.rb +0 -2
- data/lib/pushr/message_fcm.rb +6 -3
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 579d92683998de4c84a92541f753c2109c4c683d3aa39724bc384ae0c26c76d8
|
4
|
+
data.tar.gz: 18482834919c00505ff3144bbd385cb0adc276a357d52b711b4d5772d601edba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eafac795cd373d0fc5dc1c635b2d3c27d8848c7cc236161245f13c67090af2f5e531d8fd57927f1e864be86f896c162345b07722acdbc9469aadcd09b79b63c6
|
7
|
+
data.tar.gz: 43f56841a8f1cd5bc00327b367e197079c65975d4ff48c499ecaa181267adecc0d36baf7edd541dc66e25b3c4b1a81cf0045684c969eb91be09225a34076e089
|
data/lib/pushr-fcm/version.rb
CHANGED
@@ -25,7 +25,6 @@ module Pushr
|
|
25
25
|
def write(data)
|
26
26
|
retry_count = 0
|
27
27
|
begin
|
28
|
-
puts data.to_message
|
29
28
|
response = notification_request(data.to_message)
|
30
29
|
handler = Pushr::Daemon::FcmSupport::ResponseHandler.new(response, data, retry_count)
|
31
30
|
handler.handle
|
@@ -61,7 +60,6 @@ module Pushr
|
|
61
60
|
|
62
61
|
begin
|
63
62
|
response = @connection.post(uri.path, data, headers)
|
64
|
-
puts response.inspect
|
65
63
|
@last_use = Time.now
|
66
64
|
rescue EOFError, Errno::ECONNRESET, Timeout::Error => e
|
67
65
|
retry_count += 1
|
data/lib/pushr/message_fcm.rb
CHANGED
@@ -2,7 +2,7 @@ module Pushr
|
|
2
2
|
class MessageFcm < Pushr::Message
|
3
3
|
POSTFIX = 'fcm'.freeze
|
4
4
|
|
5
|
-
attr_accessor :name, :data, :notification, :android, :webpush, :apns, :token, :topic, :condition
|
5
|
+
attr_accessor :name, :data, :notification, :android, :webpush, :apns, :fcm_options, :token, :topic, :condition
|
6
6
|
|
7
7
|
# {
|
8
8
|
# "name": string,
|
@@ -22,6 +22,9 @@ module Pushr
|
|
22
22
|
# "apns": {
|
23
23
|
# object(ApnsConfig)
|
24
24
|
# },
|
25
|
+
# "fcm_options": {
|
26
|
+
# object (FcmOptions)
|
27
|
+
# },
|
25
28
|
#
|
26
29
|
# // Union field target can be only one of the following:
|
27
30
|
# "token": string,
|
@@ -32,7 +35,7 @@ module Pushr
|
|
32
35
|
|
33
36
|
def to_message
|
34
37
|
hsh = {}
|
35
|
-
%w[name data notification android webpush apns token topic condition].each do |variable|
|
38
|
+
%w[name data notification android webpush apns fcm_options token topic condition].each do |variable|
|
36
39
|
hsh[variable] = send(variable) if send(variable)
|
37
40
|
end
|
38
41
|
MultiJson.dump(message: hsh)
|
@@ -40,7 +43,7 @@ module Pushr
|
|
40
43
|
|
41
44
|
def to_hash
|
42
45
|
hsh = { type: self.class.to_s, app: app, name: name, data: data, notification: notification, android: android,
|
43
|
-
webpush: webpush, apns: apns, token: token, topic: topic, condition: condition }
|
46
|
+
webpush: webpush, apns: apns, fcm_options: fcm_options, token: token, topic: topic, condition: condition }
|
44
47
|
hsh[Pushr::Core.external_id_tag] = external_id if external_id
|
45
48
|
hsh
|
46
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pushr-fcm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Pesman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -250,12 +250,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
250
250
|
version: 2.2.0
|
251
251
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
252
252
|
requirements:
|
253
|
-
- - "
|
253
|
+
- - ">="
|
254
254
|
- !ruby/object:Gem::Version
|
255
|
-
version:
|
255
|
+
version: '0'
|
256
256
|
requirements: []
|
257
|
-
|
258
|
-
rubygems_version: 2.7.6
|
257
|
+
rubygems_version: 3.0.6
|
259
258
|
signing_key:
|
260
259
|
specification_version: 4
|
261
260
|
summary: FCM (Android) part of the modular push daemon.
|