p8_pusher 0.1.1 → 1.0.0

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: 3872727dc97450e2297219392cdd92de2c155769199b53e1d1311ece3d624a73
4
- data.tar.gz: f492a5c7e4a5ad7d7cadec6c4afd2b3001f1d7c983b2a2c8b27f88a686511053
3
+ metadata.gz: e799d13293d08f5ce5c16c4c322010af333ca7530a900075d4fa7319a04b7852
4
+ data.tar.gz: 7b5aefc658a907c65ca494c1c89b4f9490be2b30ac0690a2eefc0ce79e1220e1
5
5
  SHA512:
6
- metadata.gz: 429064222a675fef9689927f79790df0cd9d2c5cfdfb759e84caff96dbeecd6ae3e65ed160834211b94773663063f44dabbc69ee4f96087e538b939952c9d816
7
- data.tar.gz: 5f537298b047b0dbce4a5fb15519271bdbed6d769977534a989a2eae91177e7dc0ee957c9e492e25c9ad5f94b8dcb7486c3156c62e2ef0d8253c828d5dce448e
6
+ metadata.gz: f5e586bda3717e9df2187017368e4352ce91789b8955b86c371ae3cd48769eb63e9b05d6addc52a785444ec61a362db860f9c9df8fe2f261c5612379d7673037
7
+ data.tar.gz: 7083b86ab9f6b20291519292cf76f7a71b873ec5ef0159846a4cb495554eeb8a1187a278e8db4fe2813c99d83a2afeabfc5161575c7ed8eb22cefb8d36d47cf7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- p8_pusher (0.1.0)
4
+ p8_pusher (0.1.1)
5
5
  commander (~> 4.5)
6
6
  json (~> 2.3)
7
7
  jwt (~> 2.2)
@@ -29,7 +29,7 @@ module P8Pusher
29
29
 
30
30
  MAXIMUM_PAYLOAD_SIZE = 2048
31
31
 
32
- attr_accessor :topic, :token, :alert, :badge, :sound, :category, :content_available, :mutable_content,
32
+ attr_accessor :topic, :token, :title, :subtitle, :body, :badge, :sound, :category, :content_available, :mutable_content,
33
33
  :custom_data, :id, :expiry, :priority
34
34
  attr_reader :sent_at
35
35
  attr_writer :apns_error_code
@@ -39,7 +39,9 @@ module P8Pusher
39
39
 
40
40
  def initialize(options = {})
41
41
  @token = options.delete(:token) || options.delete(:device)
42
- @alert = options.delete(:alert)
42
+ @title = options.delete(:title)
43
+ @subtitle = options.delete(:subtitle)
44
+ @body = options.delete(:body)
43
45
  @topic = options.delete(:topic) || ENV['APN_BUNDLE_ID']
44
46
  @badge = options.delete(:badge)
45
47
  @sound = options.delete(:sound)
@@ -57,7 +59,10 @@ module P8Pusher
57
59
  json = {}.merge(@custom_data || {}).inject({}) { |h, (k, v)| h[k.to_s] = v; h }
58
60
 
59
61
  json['aps'] ||= {}
60
- json['aps']['alert'] = @alert if @alert
62
+ json['aps']['alert'] ||= {}
63
+ json['aps']['alert']['title'] = @title if @title
64
+ json['aps']['alert']['subtitle'] = @subtitle if @subtitle
65
+ json['aps']['alert']['body'] = @body if @body
61
66
  json['aps']['badge'] = @badge&.to_i if @badge
62
67
  json['aps']['sound'] = @sound if @sound
63
68
  json['aps']['category'] = @category if @category
@@ -1,3 +1,3 @@
1
1
  module P8Pusher
2
- VERSION = "0.1.1"
2
+ VERSION = '1.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: p8_pusher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sajjad Umar (sumar7)