fcmpush 1.4.3 → 1.5.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/fcmpush.gemspec +1 -1
- data/lib/fcmpush/client.rb +11 -5
- data/lib/fcmpush/configuration.rb +5 -1
- data/lib/fcmpush/exceptions.rb +1 -0
- data/lib/fcmpush/version.rb +1 -1
- metadata +4 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a437176b9b06e22c8ccbfc7caed5603ff2fc331111c22dbfc585dceb782ab6f2
|
4
|
+
data.tar.gz: 250617403b4caa35cda5395fca5daef64649dd428e20c5f1e619561984bf8ef8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5628699a3505d7dbc67c7b62fd90b15db6177f97dec2e1f979b4c6bb79b41496104af8325db819b3b83a354a3dec120d5e965b5eee7f5be5a945bba2da652923
|
7
|
+
data.tar.gz: 4cdbbde0ea2649e681756c9b66671cc60dfff34b062886dd22a01af8b39284a4ce202916f393aa3c92e64939f1302c31fd3ec002aa5c967fd7963e99b181f189
|
data/fcmpush.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
|
-
spec.required_ruby_version = '>= 2.6', '< 3.
|
25
|
+
spec.required_ruby_version = '>= 2.6', '< 3.5'
|
26
26
|
|
27
27
|
spec.add_dependency 'google-apis-identitytoolkit_v3'
|
28
28
|
spec.add_dependency 'net-http-persistent', '~> 4.0.1'
|
data/lib/fcmpush/client.rb
CHANGED
@@ -26,6 +26,9 @@ module Fcmpush
|
|
26
26
|
# @server_key = configuration.server_key
|
27
27
|
@connection = Net::HTTP::Persistent.new
|
28
28
|
|
29
|
+
@connection.open_timeout = configuration.open_timeout if configuration.open_timeout
|
30
|
+
@connection.read_timeout = configuration.read_timeout if configuration.read_timeout
|
31
|
+
|
29
32
|
if !configuration.proxy
|
30
33
|
# do nothing
|
31
34
|
elsif configuration.proxy == :ENV
|
@@ -84,12 +87,15 @@ module Fcmpush
|
|
84
87
|
raise NetworkError, "A network error occurred: #{e.class} (#{e.message})"
|
85
88
|
end
|
86
89
|
|
90
|
+
#-------------------------------------------------------------------------------
|
91
|
+
# BATCH REQUESTS DEPRECATED BY GOOGLE ON June 20,2023 AND SHUTDOWN ON June 21, 2024
|
92
|
+
# https://firebase.google.com/support/faq/#fcm-depr-features
|
93
|
+
#
|
94
|
+
# Until upgrading to use HTTP/2, warning and throwing error
|
95
|
+
#-------------------------------------------------------------------------------
|
87
96
|
def batch_push(messages, query: {}, headers: {})
|
88
|
-
|
89
|
-
|
90
|
-
BatchResponse.new(response)
|
91
|
-
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e
|
92
|
-
raise NetworkError, "A network error occurred: #{e.class} (#{e.message})"
|
97
|
+
warn '[DEPRECATION] `batch_push` is deprecated. Please use `push` for each message instead.'
|
98
|
+
raise DeprecatedApiError, 'BATCH REQUESTS DEPRECATED BY GOOGLE ON June 20,2023 AND SHUTDOWN ON June 21, 2024 (https://firebase.google.com/support/faq/#fcm-depr-features)'
|
93
99
|
end
|
94
100
|
|
95
101
|
private
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fcmpush
|
2
2
|
class Configuration
|
3
|
-
attr_accessor :scope, :json_key_io, :server_key, :proxy
|
3
|
+
attr_accessor :scope, :json_key_io, :server_key, :proxy, :open_timeout, :read_timeout
|
4
4
|
|
5
5
|
def initialize
|
6
6
|
@scope = ['https://www.googleapis.com/auth/firebase.messaging']
|
@@ -26,6 +26,10 @@ module Fcmpush
|
|
26
26
|
# cf. https://github.com/miyataka/fcmpush/pull/39#issuecomment-1722533622
|
27
27
|
# proxy
|
28
28
|
@proxy = :ENV
|
29
|
+
|
30
|
+
# connection timeouts
|
31
|
+
@open_timeout = nil
|
32
|
+
@read_timeout = nil
|
29
33
|
end
|
30
34
|
end
|
31
35
|
end
|
data/lib/fcmpush/exceptions.rb
CHANGED
data/lib/fcmpush/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fcmpush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- miyataka
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-05 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: google-apis-identitytoolkit_v3
|
@@ -80,7 +79,6 @@ dependencies:
|
|
80
79
|
- - "~>"
|
81
80
|
- !ruby/object:Gem::Version
|
82
81
|
version: '3.0'
|
83
|
-
description:
|
84
82
|
email:
|
85
83
|
- voyager.3taka28@gmail.com
|
86
84
|
executables: []
|
@@ -102,7 +100,6 @@ licenses:
|
|
102
100
|
metadata:
|
103
101
|
homepage_uri: https://github.com/miyataka/fcmpush
|
104
102
|
source_code_uri: https://github.com/miyataka/fcmpush
|
105
|
-
post_install_message:
|
106
103
|
rdoc_options: []
|
107
104
|
require_paths:
|
108
105
|
- lib
|
@@ -113,15 +110,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
113
110
|
version: '2.6'
|
114
111
|
- - "<"
|
115
112
|
- !ruby/object:Gem::Version
|
116
|
-
version: '3.
|
113
|
+
version: '3.5'
|
117
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
115
|
requirements:
|
119
116
|
- - ">="
|
120
117
|
- !ruby/object:Gem::Version
|
121
118
|
version: '0'
|
122
119
|
requirements: []
|
123
|
-
rubygems_version: 3.
|
124
|
-
signing_key:
|
120
|
+
rubygems_version: 3.6.2
|
125
121
|
specification_version: 4
|
126
122
|
summary: Firebase Cloud Messaging API wrapper for ruby, supports HTTP v1. And including
|
127
123
|
access_token Auto Refresh feature!
|