pushpad 0.10.0 → 0.11.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/README.md +2 -0
- data/lib/pushpad/notification.rb +3 -1
- data/pushpad.gemspec +2 -2
- data/spec/pushpad/notification_spec.rb +4 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67f4863ab766c1ca89b1682f5844e3ff14052485
|
4
|
+
data.tar.gz: 848e06f99b504eac246cc94d970de15dde652ca3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bde5c69aebcbbf6f8a7ede29ce2b7c75c0a46f835f32eb806bb88a827b91b0b801cdde87cdb3fd12efb34679f18bdb4eb93be709b3de01b8fed04b84465e767
|
7
|
+
data.tar.gz: 5c7666ab8ca1c40e183ce6bc15d16834e00a0df84da63969120ba894ea72b455d5888b09c647d0d2520d73d217c05de6a6d8d4b4059e8a49a0be03508aa10b78
|
data/README.md
CHANGED
@@ -62,6 +62,7 @@ notification = Pushpad::Notification.new({
|
|
62
62
|
image_url: "http://example.com/assets/image.png", # optional, an image to display in the notification content
|
63
63
|
ttl: 604800, # optional, drop the notification after this number of seconds if a device is offline
|
64
64
|
require_interaction: true, # optional, prevent Chrome on desktop from automatically closing the notification after a few seconds
|
65
|
+
urgent: false, # optional, enable this option only for time-sensitive alerts (e.g. incoming phone call)
|
65
66
|
custom_data: "123", # optional, a string that is passed as an argument to action button callbacks
|
66
67
|
# optional, add some action buttons to the notification
|
67
68
|
# see https://pushpad.xyz/docs/action_buttons
|
@@ -140,6 +141,7 @@ notification.body # => "Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
140
141
|
notification.target_url # => "http://example.com",
|
141
142
|
notification.ttl # => 604800,
|
142
143
|
notification.require_interaction # => false,
|
144
|
+
notification.urgent # => false,
|
143
145
|
notification.icon_url # => "http://example.com/assets/icon.png",
|
144
146
|
|
145
147
|
# `created_at` is a `Time` instance
|
data/lib/pushpad/notification.rb
CHANGED
@@ -12,7 +12,7 @@ module Pushpad
|
|
12
12
|
class ReadonlyError < RuntimeError
|
13
13
|
end
|
14
14
|
|
15
|
-
attr_accessor :body, :title, :target_url, :icon_url, :image_url, :ttl, :require_interaction, :custom_data, :custom_metrics, :actions, :starred, :send_at
|
15
|
+
attr_accessor :body, :title, :target_url, :icon_url, :image_url, :ttl, :require_interaction, :urgent, :custom_data, :custom_metrics, :actions, :starred, :send_at
|
16
16
|
attr_reader :id, :created_at, :scheduled_count, :successfully_sent_count, :opened_count
|
17
17
|
|
18
18
|
def initialize(options)
|
@@ -29,6 +29,7 @@ module Pushpad
|
|
29
29
|
@image_url = options[:image_url]
|
30
30
|
@ttl = options[:ttl]
|
31
31
|
@require_interaction = options[:require_interaction]
|
32
|
+
@urgent = options[:urgent]
|
32
33
|
@custom_data = options[:custom_data]
|
33
34
|
@custom_metrics = options[:custom_metrics]
|
34
35
|
@actions = options[:actions]
|
@@ -117,6 +118,7 @@ module Pushpad
|
|
117
118
|
notification_params["image_url"] = self.image_url if self.image_url
|
118
119
|
notification_params["ttl"] = self.ttl if self.ttl
|
119
120
|
notification_params["require_interaction"] = self.require_interaction unless self.require_interaction.nil?
|
121
|
+
notification_params["urgent"] = self.urgent unless self.urgent.nil?
|
120
122
|
notification_params["custom_data"] = self.custom_data if self.custom_data
|
121
123
|
notification_params["custom_metrics"] = self.custom_metrics if self.custom_metrics
|
122
124
|
notification_params["actions"] = self.actions if self.actions
|
data/pushpad.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "pushpad"
|
3
|
-
spec.version = '0.
|
3
|
+
spec.version = '0.11.0'
|
4
4
|
spec.authors = ["Pushpad"]
|
5
5
|
spec.email = ["support@pushpad.xyz"]
|
6
|
-
spec.summary = "Web push notifications for Chrome, Firefox and Safari using Pushpad."
|
6
|
+
spec.summary = "Web push notifications for Chrome, Firefox, Opera, Edge and Safari using Pushpad."
|
7
7
|
spec.homepage = "https://pushpad.xyz"
|
8
8
|
spec.license = "MIT"
|
9
9
|
spec.files = `git ls-files`.split("\n")
|
@@ -59,6 +59,7 @@ module Pushpad
|
|
59
59
|
created_at: "2016-07-06T10:09:14.835Z",
|
60
60
|
ttl: 604800,
|
61
61
|
require_interaction: false,
|
62
|
+
urgent: false,
|
62
63
|
icon_url: "https://example.com/assets/icon.png",
|
63
64
|
scheduled_count: 2,
|
64
65
|
successfully_sent_count: 4,
|
@@ -112,6 +113,7 @@ module Pushpad
|
|
112
113
|
created_at: "2016-07-06T10:09:14.835Z",
|
113
114
|
ttl: 604800,
|
114
115
|
require_interaction: false,
|
116
|
+
urgent: false,
|
115
117
|
icon_url: "https://example.com/assets/icon.png",
|
116
118
|
scheduled_count: 2,
|
117
119
|
successfully_sent_count: 4,
|
@@ -277,6 +279,7 @@ module Pushpad
|
|
277
279
|
image_url: "http://example.com/assets/image.png",
|
278
280
|
ttl: 604800,
|
279
281
|
require_interaction: true,
|
282
|
+
urgent: true,
|
280
283
|
custom_data: "123",
|
281
284
|
custom_metrics: ["examples", "another_metric"],
|
282
285
|
actions: [
|
@@ -358,6 +361,7 @@ module Pushpad
|
|
358
361
|
image_url: "http://example.com/assets/image.png",
|
359
362
|
ttl: 604800,
|
360
363
|
require_interaction: true,
|
364
|
+
urgent: true,
|
361
365
|
custom_data: "123",
|
362
366
|
custom_metrics: ["examples", "another_metric"],
|
363
367
|
actions: [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pushpad
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pushpad
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -82,10 +82,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.5
|
85
|
+
rubygems_version: 2.4.5
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
|
-
summary: Web push notifications for Chrome, Firefox and Safari using
|
88
|
+
summary: Web push notifications for Chrome, Firefox, Opera, Edge and Safari using
|
89
|
+
Pushpad.
|
89
90
|
test_files:
|
90
91
|
- spec/pushpad/notification_spec.rb
|
91
92
|
- spec/pushpad/request_spec.rb
|