ts_p8push 1.0.8 → 1.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
  SHA256:
3
- metadata.gz: 21b146e5570c44da7ac9d83ec7a92369e8d492b0b73f4b904c68b930dfbc292a
4
- data.tar.gz: 5892d8c28149654cc7837f58a5e6c06d4e5c8caed943015f38b3b177b0e62732
3
+ metadata.gz: 0b7a23e2b2c147643de610af283df24b79e8d1044858f75b536ed646720ca52c
4
+ data.tar.gz: 397c9800e117aa52f8e00999251d0575b77903ee7bfc1ba895053b7086dcf08e
5
5
  SHA512:
6
- metadata.gz: 9ed70ae53f445edd9c08ebba0badd42e976cc61947768544da6eccd897b11daaae4aff9c0d8906ac63cb554c13687e641d9f5a91155ea8eb625cc8e6366ccb6f
7
- data.tar.gz: b2f3dc802065944d3f3cc0724924bb88b70b54eabadc7865dc6393e679c4cf0090f6e6798c0eb64ffe913f326be15ec81980921a709f3a419afadf0eeb483b8b
6
+ metadata.gz: 2af01065e809342e2393046dcb90a017e4f2205a3548f32f3e5da36292526a44b2ea3174b251c4105a6fc75f05c704f6abc493518636a8eb5f95bee0441162ce
7
+ data.tar.gz: 00f24c0d707c0081e107b9f2128c106212eccbca06e81d2e7828fda32a276513071789c949e9df02368b97ecc0288c977a874554e916f8de3cc221fc2b8ea45d
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,8 +38,13 @@ 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'
44
+
45
+
46
+ puts payload.inspect
47
+
43
48
  res = client.call(:post, '/3/device/'+token, body: payload.to_json, timeout: @timeout,
44
49
  headers: h)
45
50
  client.close
@@ -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.to_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.8'
2
+ VERSION = '1.1.3'
3
3
  end
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.8
4
+ version: 1.1.3
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
@@ -86,6 +86,11 @@ files:
86
86
  - "./lib/ts_p8push.rb"
87
87
  - "./p8push.gemspec"
88
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"
93
+ - "./ts_p8push-1.1.2.gem"
89
94
  homepage: https://talhashoaib.me
90
95
  licenses:
91
96
  - MIT