ts_p8push 1.0.9 → 1.1.4

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: ef00369583da57c6a37bc90bee3a2faacdbe2f3aa6b9f97cc778495ae9b7f22d
4
- data.tar.gz: 1714c119948a3c9189fa4f7581213eae29ed1eb51357aad690dae04e5aa0b0b7
3
+ metadata.gz: 54b02ef4e92b6a3054868dfffd8613e8a0dd97a8b48617dcec455d59f8108c11
4
+ data.tar.gz: e9bf28c09bf2eca5bd804a9da891d1432a1def41013527b6a9995367c8ab0bd4
5
5
  SHA512:
6
- metadata.gz: c5b6df0eb81504e649f7cbda63ba0543ad794b842a8ae730bffd2e5961f3f302faf68d6055b162240de25b0cc0ee6657233198402dd9a802e9cd67ac24ae0281
7
- data.tar.gz: 16862c58308ce5b9b0aa7cd75dcd67beec12c957df06cbc65e3c9bee850c9ea441db0b35879c373d3315cefa829daf04de04f0d4701eb85124029c2b8f4e16bc
6
+ metadata.gz: bb7f937b42df63ba627aaa64d50ea893e7f0e3078e88247af6537a2ba783ae78cd3d693d51462b87f96dfdaca70bbb3f41b7863395748b1496469e3c8ccbbdb2
7
+ data.tar.gz: f1c2d45ac5397e0d1bb6ad72293f4ecc4e2eb4e74471b59725bbbc4be9196d8421a73604a72fa3ad1f8aafce3df42bc34615bc51a79d54997087b68be933c1df
data/lib/p8push/client.rb CHANGED
@@ -41,6 +41,10 @@ module P8push
41
41
  h['scheme'] = 'https'
42
42
  h['authorization'] = "bearer #{jwt_token}"
43
43
  h['content-type'] = 'application/json'
44
+
45
+
46
+ puts payload.inspect
47
+
44
48
  res = client.call(:post, '/3/device/'+token, body: payload.to_json, timeout: @timeout,
45
49
  headers: h)
46
50
  client.close
@@ -29,7 +29,7 @@ module P8push
29
29
  MAXIMUM_PAYLOAD_SIZE = 2048
30
30
 
31
31
  attr_accessor :topic, :token, :alert, :badge, :sound, :category, :content_available, :mutable_content,
32
- :custom_data, :id, :expiry, :priority, :title, :body
32
+ :custom_data, :id, :expiry, :priority
33
33
  attr_reader :sent_at
34
34
  attr_writer :apns_error_code
35
35
 
@@ -39,8 +39,6 @@ module P8push
39
39
  def initialize(options = {})
40
40
  @token = options.delete(:token) || options.delete(:device)
41
41
  @alert = options.delete(:alert)
42
- @title = options.delete(:title)
43
- @body = options.delete(:body)
44
42
  @topic = options.delete(:topic) || ENV['APN_BUNDLE_ID']
45
43
  @badge = options.delete(:badge)
46
44
  @sound = options.delete(:sound)
@@ -58,8 +56,7 @@ module P8push
58
56
  json = {}.merge(@custom_data || {}).inject({}) { |h, (k, v)| h[k.to_s] = v; h }
59
57
 
60
58
  json['aps'] ||= {}
61
- # json['aps']['alert'] = @alert if @alert
62
- json['aps']['alert'] = {'title': @title, 'body': @body}
59
+ json['aps']['alert'] = @alert.as_json if @alert
63
60
  json['aps']['badge'] = @badge.to_i rescue 0 if @badge
64
61
  json['aps']['sound'] = @sound if @sound
65
62
  json['aps']['category'] = @category if @category
@@ -1,3 +1,3 @@
1
1
  module P8push
2
- VERSION = '1.0.9'
2
+ VERSION = '1.1.4'
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.9
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Arrow
@@ -87,6 +87,11 @@ files:
87
87
  - "./p8push.gemspec"
88
88
  - "./ts_p8push-1.0.7.gem"
89
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"
94
+ - "./ts_p8push-1.1.3.gem"
90
95
  homepage: https://talhashoaib.me
91
96
  licenses:
92
97
  - MIT