ts_p8push 1.0.7 → 1.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d32a8f34ba8a667ee1b4d736c82e1731b2bcb82e0a7f93383e7d67912092475
4
- data.tar.gz: d7ddaa9a8f768298966d4e33ed7d3cbba6a2185fe0b21745e4453004d1670930
3
+ metadata.gz: eb6241c6d144d5d9b02eb5db21bc6dc35d6871d1f9021c5fd4e32c452bbb1541
4
+ data.tar.gz: de79a6b99b372c16dffd49c87ac1dd7a4be1a8df5e5eab2aeed7d3836b847586
5
5
  SHA512:
6
- metadata.gz: 268abdeba968f435a6da77fe8e2a4b15f273617c94341f7dead9b6b1d11fad7a77554f94a63dd8dec6019726d0f2ead72ee8880df1b0e0d9263d40faf1fbd338
7
- data.tar.gz: f4d4431dfeb4fe65d575ae0eac03e12d5222a1a518dd2e8638c7931637d352716d4be4aaa1d93a981694039ebc31a35a27a74ecda926bbdb16e0c72cab4cc62a
6
+ metadata.gz: 98b8e98e8c684b2ba8f424c0d4f602881ba587c875aefbbb92b87baf5813e01d0782f9a5b6dcf06d9947b0ba91f5f5851c55127d439a36010c14177be657305d
7
+ data.tar.gz: 9cb446dfbd4b5bbe4995ebf14f0ea816160f8adb89ca67a6be46daeeeb7b5ad0226bdd45e6c1159549d9d7a6e1ddc1a1e848fc1c0852f4c099c1b6fbb61daff6
data/lib/p8push/client.rb CHANGED
@@ -27,7 +27,7 @@ module P8push
27
27
  @private_key = private_key || File.read(ENV['APN_PRIVATE_KEY'])
28
28
  @team_id = team_id || ENV['APN_TEAM_ID']
29
29
  @key_id = key_id || ENV['APN_KEY_ID']
30
- @timeout = timeout || Float(ENV['APN_TIMEOUT'] || 2.0)
30
+ @timeout = Float(timeout || ENV['APN_TIMEOUT'] || 2.0) rescue 2.0
31
31
  end
32
32
 
33
33
  def jwt_http2_post(topic, payload, token)
@@ -38,9 +38,14 @@ module P8push
38
38
  h['apns-expiration'] = '0'
39
39
  h['apns-priority'] = '10'
40
40
  h['apns-topic'] = topic
41
+ h['scheme'] = 'https'
41
42
  h['authorization'] = "bearer #{jwt_token}"
42
43
  h['content-type'] = 'application/json'
43
- res = client.call(:post, '/3/device/'+token, body: payload.to_json, timeout: @timeout,
44
+
45
+
46
+ puts payload.inspect
47
+
48
+ res = client.call(:post, '/3/device/'+token, body: payload.as_json, timeout: @timeout,
44
49
  headers: h)
45
50
  client.close
46
51
  return nil if res.status.to_i == 200
@@ -56,7 +56,7 @@ module P8push
56
56
  json = {}.merge(@custom_data || {}).inject({}) { |h, (k, v)| h[k.to_s] = v; h }
57
57
 
58
58
  json['aps'] ||= {}
59
- json['aps']['alert'] = @alert if @alert
59
+ json['aps']['alert'] = @alert.as_json if @alert
60
60
  json['aps']['badge'] = @badge.to_i rescue 0 if @badge
61
61
  json['aps']['sound'] = @sound if @sound
62
62
  json['aps']['category'] = @category if @category
@@ -1,3 +1,3 @@
1
1
  module P8push
2
- VERSION = '1.0.7'
2
+ VERSION = '1.1.2'
3
3
  end
File without changes
Binary file
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ts_p8push
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Arrow
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-06-02 00:00:00.000000000 Z
14
+ date: 2021-06-04 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: jwt
@@ -80,11 +80,16 @@ files:
80
80
  - "./LICENSE"
81
81
  - "./README.md"
82
82
  - "./Rakefile"
83
- - "./lib/klap_p8push.rb"
84
83
  - "./lib/p8push/client.rb"
85
84
  - "./lib/p8push/notification.rb"
86
85
  - "./lib/p8push/version.rb"
86
+ - "./lib/ts_p8push.rb"
87
87
  - "./p8push.gemspec"
88
+ - "./ts_p8push-1.0.7.gem"
89
+ - "./ts_p8push-1.0.8.gem"
90
+ - "./ts_p8push-1.0.9.gem"
91
+ - "./ts_p8push-1.1.0.gem"
92
+ - "./ts_p8push-1.1.1.gem"
88
93
  homepage: https://talhashoaib.me
89
94
  licenses:
90
95
  - MIT