pushpad 0.13.0 → 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/.github/workflows/ci.yml +1 -1
- data/README.md +14 -14
- data/lib/pushpad.rb +1 -1
- data/pushpad.gemspec +1 -1
- data/spec/pushpad_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48d7160263b210c7897b4171bb69b21916e155e3e3c5c252a23ab99f0d64252d
|
4
|
+
data.tar.gz: e06bc7a3e1d946403e45cc4ed57672d1fd97e4076d9d0538bf42ba7b13a5aaf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33bc016ccd42f4ea8cced6e3b0a98e91c22c196ff1481b504f64ae231ec0ff0d67c4e47bd5fb5fd0ab42c544d3d97e559893ed85d71cce7057e355a5d138863e
|
7
|
+
data.tar.gz: 927b49b786b2ed3114d6a1c8b88dddcea72a21c6688a4bc9adc51e6206a5a0d6229134fdaace40c7687e957f0eba3a7045edb1e512ccfac4436568704bcdf803
|
data/.github/workflows/ci.yml
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[](https://badge.fury.io/rb/pushpad)
|
4
4
|

|
5
5
|
|
6
|
-
[Pushpad](https://pushpad.xyz) is a service for sending push notifications from your web app. It supports the **Push API** (Chrome, Firefox, Opera, Edge) and **APNs** (Safari).
|
6
|
+
[Pushpad](https://pushpad.xyz) is a service for sending push notifications from your web app. It supports the **Push API** (Chrome, Firefox, Opera, Edge) and **APNs** (Safari desktop). iOS support is coming in 2023.
|
7
7
|
|
8
8
|
Features:
|
9
9
|
|
@@ -59,7 +59,7 @@ notification = Pushpad::Notification.new({
|
|
59
59
|
title: "Website Name", # optional, defaults to your project name
|
60
60
|
target_url: "https://example.com", # optional, defaults to your project website
|
61
61
|
icon_url: "https://example.com/assets/icon.png", # optional, defaults to the project icon
|
62
|
-
badge_url: "https://example.com/assets/badge.png" # optional, defaults to the project badge
|
62
|
+
badge_url: "https://example.com/assets/badge.png", # optional, defaults to the project badge
|
63
63
|
image_url: "https://example.com/assets/image.png", # optional, an image to display in the notification content
|
64
64
|
ttl: 604800, # optional, drop the notification after this number of seconds if a device is offline
|
65
65
|
require_interaction: true, # optional, prevent Chrome on desktop from automatically closing the notification after a few seconds
|
@@ -138,22 +138,22 @@ notification = Pushpad::Notification.find(42)
|
|
138
138
|
|
139
139
|
# get basic attributes
|
140
140
|
notification.id # => 42
|
141
|
-
notification.title # => "Foo Bar"
|
142
|
-
notification.body # => "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
143
|
-
notification.target_url # => "https://example.com"
|
144
|
-
notification.ttl # => 604800
|
145
|
-
notification.require_interaction # => false
|
146
|
-
notification.silent # => false
|
147
|
-
notification.urgent # => false
|
148
|
-
notification.icon_url # => "https://example.com/assets/icon.png"
|
149
|
-
notification.badge_url # => "https://example.com/assets/badge.png"
|
141
|
+
notification.title # => "Foo Bar"
|
142
|
+
notification.body # => "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
143
|
+
notification.target_url # => "https://example.com"
|
144
|
+
notification.ttl # => 604800
|
145
|
+
notification.require_interaction # => false
|
146
|
+
notification.silent # => false
|
147
|
+
notification.urgent # => false
|
148
|
+
notification.icon_url # => "https://example.com/assets/icon.png"
|
149
|
+
notification.badge_url # => "https://example.com/assets/badge.png"
|
150
150
|
|
151
151
|
# `created_at` is a `Time` instance
|
152
|
-
notification.created_at.utc.to_s # => "2016-07-06 10:09:14 UTC"
|
152
|
+
notification.created_at.utc.to_s # => "2016-07-06 10:09:14 UTC"
|
153
153
|
|
154
154
|
# get statistics
|
155
155
|
notification.scheduled_count # => 1
|
156
|
-
notification.successfully_sent_count # => 4
|
156
|
+
notification.successfully_sent_count # => 4
|
157
157
|
notification.opened_count # => 2
|
158
158
|
```
|
159
159
|
|
@@ -164,7 +164,7 @@ notifications = Pushpad::Notification.find_all(project_id: 5)
|
|
164
164
|
|
165
165
|
# same attributes as for single notification in example above
|
166
166
|
notifications[0].id # => 42
|
167
|
-
notifications[0].title # => "Foo Bar"
|
167
|
+
notifications[0].title # => "Foo Bar"
|
168
168
|
```
|
169
169
|
|
170
170
|
If `Pushpad.project_id` is defined, the `project_id` option can be
|
data/lib/pushpad.rb
CHANGED
@@ -26,7 +26,7 @@ module Pushpad
|
|
26
26
|
|
27
27
|
def self.signature_for(data)
|
28
28
|
raise "You must set Pushpad.auth_token" unless Pushpad.auth_token
|
29
|
-
OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('
|
29
|
+
OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), self.auth_token, data.to_s)
|
30
30
|
end
|
31
31
|
|
32
32
|
end
|
data/pushpad.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "pushpad"
|
3
|
-
spec.version = '0.
|
3
|
+
spec.version = '1.0.0'
|
4
4
|
spec.authors = ["Pushpad"]
|
5
5
|
spec.email = ["support@pushpad.xyz"]
|
6
6
|
spec.summary = "Web push notifications for Chrome, Firefox, Opera, Edge and Safari using Pushpad."
|
data/spec/pushpad_spec.rb
CHANGED
@@ -16,9 +16,9 @@ describe Pushpad do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
describe "#signature_for" do
|
19
|
-
it "produces the hex-encoded HMAC-
|
19
|
+
it "produces the hex-encoded HMAC-SHA256 signature for the data passed as argument" do
|
20
20
|
signature = Pushpad.signature_for('myuid1')
|
21
|
-
expect(signature).to eq '
|
21
|
+
expect(signature).to eq 'd213a2f146dd9aae9cb935b5233d42fecc9414e2b0e98896af7a43e7fce3ef31'
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
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: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pushpad
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
|
-
rubygems_version: 3.
|
84
|
+
rubygems_version: 3.3.26
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: Web push notifications for Chrome, Firefox, Opera, Edge and Safari using
|