p8_pusher 0.1.1 → 1.0.0
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/p8_pusher/notification.rb +8 -3
- data/lib/p8_pusher/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e799d13293d08f5ce5c16c4c322010af333ca7530a900075d4fa7319a04b7852
|
|
4
|
+
data.tar.gz: 7b5aefc658a907c65ca494c1c89b4f9490be2b30ac0690a2eefc0ce79e1220e1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f5e586bda3717e9df2187017368e4352ce91789b8955b86c371ae3cd48769eb63e9b05d6addc52a785444ec61a362db860f9c9df8fe2f261c5612379d7673037
|
|
7
|
+
data.tar.gz: 7083b86ab9f6b20291519292cf76f7a71b873ec5ef0159846a4cb495554eeb8a1187a278e8db4fe2813c99d83a2afeabfc5161575c7ed8eb22cefb8d36d47cf7
|
data/Gemfile.lock
CHANGED
|
@@ -29,7 +29,7 @@ module P8Pusher
|
|
|
29
29
|
|
|
30
30
|
MAXIMUM_PAYLOAD_SIZE = 2048
|
|
31
31
|
|
|
32
|
-
attr_accessor :topic, :token, :
|
|
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
|
-
@
|
|
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']
|
|
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
|
data/lib/p8_pusher/version.rb
CHANGED