ts_p8push 1.1.0 → 1.1.5

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: 9157428f246ccf247d785321bac8acdda1e80e7669f36ca23c952b89630d82ab
4
- data.tar.gz: 16075c32def63a69fa676cb614326ec50237b5c268955f1b1c6d8e56ae49d063
3
+ metadata.gz: 8c423539e7717bb1e16bff3656d75178920320d8b362b23c2739771ea9bcd5a6
4
+ data.tar.gz: ff543ede6be5b447db771d2479b8b572a9f8f3565452ad3c3fc562e0ecdef88d
5
5
  SHA512:
6
- metadata.gz: a2e4c7da29520fd8fea6f27ba46005579ca796dfc9a30012e22ed5b8f4a0b56562936826565640dd39ed7976bd2d00cecc851851c0be861a5408818c59f15a1b
7
- data.tar.gz: a655dc32e991d469395c0cff8c398017a1272a6a0f5c5e1be624f1ed09720cc2252700b00ddfd1e7ab746134aae08a2bc96a4b2e6337bf995291338f710049c7
6
+ metadata.gz: 4f15ba649c354fa9e539058d0ed2bf1d1328d98e41507f9895dfe441e6e88d286a47d0d786ce41a1ae03a3c0671bd8225b7a16227b4a708615647c6a98719419
7
+ data.tar.gz: 3f54b234b2f55142cf0cc9e33fc94679309ce151c52430b3fa470f6df96d8dd093cd681e48af724bb5e8727be4de647f5ac2976a7028bb4c9d43e6df53591b0d
data/lib/p8push/client.rb CHANGED
@@ -42,9 +42,6 @@ module P8push
42
42
  h['authorization'] = "bearer #{jwt_token}"
43
43
  h['content-type'] = 'application/json'
44
44
 
45
-
46
- puts payload.inspect
47
-
48
45
  res = client.call(:post, '/3/device/'+token, body: payload.to_json, timeout: @timeout,
49
46
  headers: h)
50
47
  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, :media_url
33
33
  attr_reader :sent_at
34
34
  attr_writer :apns_error_code
35
35
 
@@ -39,8 +39,7 @@ 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)
42
+ @media_url = options.delete(:media_url)
44
43
  @topic = options.delete(:topic) || ENV['APN_BUNDLE_ID']
45
44
  @badge = options.delete(:badge)
46
45
  @sound = options.delete(:sound)
@@ -58,13 +57,13 @@ module P8push
58
57
  json = {}.merge(@custom_data || {}).inject({}) { |h, (k, v)| h[k.to_s] = v; h }
59
58
 
60
59
  json['aps'] ||= {}
61
- # json['aps']['alert'] = @alert if @alert
62
- json['aps']['alert'] = {'title': @title, 'body': @body}
60
+ json['aps']['alert'] = @alert.as_json if @alert
63
61
  json['aps']['badge'] = @badge.to_i rescue 0 if @badge
64
62
  json['aps']['sound'] = @sound if @sound
65
63
  json['aps']['category'] = @category if @category
66
64
  json['aps']['content-available'] = 1 if @content_available
67
65
  json['aps']['mutable-content'] = 1 if @mutable_content
66
+ json['media-url'] = @media_url.present? ? "#{@media_url}" : ""
68
67
 
69
68
  json
70
69
  end
@@ -1,3 +1,3 @@
1
1
  module P8push
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.5'
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.1.0
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Arrow
@@ -88,6 +88,11 @@ files:
88
88
  - "./ts_p8push-1.0.7.gem"
89
89
  - "./ts_p8push-1.0.8.gem"
90
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"
95
+ - "./ts_p8push-1.1.4.gem"
91
96
  homepage: https://talhashoaib.me
92
97
  licenses:
93
98
  - MIT