pushpad 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -26
- data/lib/pushpad.rb +0 -11
- data/pushpad.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0d7a5fc22b88e4e06a7f1707237aead2e78afad
|
4
|
+
data.tar.gz: 9a82080f91255d1e9320af677e1dd69811eea9d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0cabfae2f5d17223f2b3be407268c0f6e0989e132d882488f48ffe9fd17fd2c5c245bcf51d601904f1bcc3859f101ff98171285bc0d9d71f0709cec65910b3f
|
7
|
+
data.tar.gz: e671730c9e098498d76c895ee0e8d01c2d1000aaa4a116b5e4c600f6ec503ecc24ebf89cc813795e1652f97a88e71c9c55da567461d23f469a79e49db80b1e06
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[![Build Status](https://travis-ci.org/pushpad/pushpad-ruby.svg?branch=master)](https://travis-ci.org/pushpad/pushpad-ruby)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/pushpad.svg)](https://badge.fury.io/rb/pushpad)
|
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) 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).
|
7
7
|
|
8
8
|
Features:
|
9
9
|
|
@@ -11,13 +11,6 @@ Features:
|
|
11
11
|
- users don't need to install any app or plugin
|
12
12
|
- you can target specific users or send bulk notifications
|
13
13
|
|
14
|
-
Currently push notifications work on the following browsers:
|
15
|
-
|
16
|
-
- Chrome (Desktop and Android)
|
17
|
-
- Firefox (44+)
|
18
|
-
- Opera (42+)
|
19
|
-
- Safari
|
20
|
-
|
21
14
|
## Installation
|
22
15
|
|
23
16
|
Add this line to your application's Gemfile:
|
@@ -50,11 +43,7 @@ Pushpad.project_id = 123 # set it here or pass it as a param to methods later
|
|
50
43
|
|
51
44
|
## Collecting user subscriptions to push notifications
|
52
45
|
|
53
|
-
|
54
|
-
|
55
|
-
### Pushpad Pro
|
56
|
-
|
57
|
-
Choose Pushpad Pro if you want to use Javascript for a seamless integration. [Read the docs](https://pushpad.xyz/docs/pushpad_pro_getting_started)
|
46
|
+
You can subscribe the users to your notifications using the Javascript SDK, as described in the [getting started guide](https://pushpad.xyz/docs/pushpad_pro_getting_started).
|
58
47
|
|
59
48
|
If you need to generate the HMAC signature for the `uid` you can use this helper:
|
60
49
|
|
@@ -62,19 +51,6 @@ If you need to generate the HMAC signature for the `uid` you can use this helper
|
|
62
51
|
Pushpad.signature_for current_user.id
|
63
52
|
```
|
64
53
|
|
65
|
-
### Pushpad Express
|
66
|
-
|
67
|
-
If you want to use Pushpad Express, add a link to your website to let users subscribe to push notifications:
|
68
|
-
|
69
|
-
```erb
|
70
|
-
<a href="<%= Pushpad.path %>">Push notifications</a>
|
71
|
-
|
72
|
-
<!-- If the user is logged in on your website you should track its user id to target him in the future -->
|
73
|
-
<a href="<%= Pushpad.path_for current_user # or current_user_id %>">Push notifications</a>
|
74
|
-
```
|
75
|
-
|
76
|
-
When a user clicks the link is sent to Pushpad, asked to receive push notifications and redirected back to your website.
|
77
|
-
|
78
54
|
## Sending push notifications
|
79
55
|
|
80
56
|
```ruby
|
data/lib/pushpad.rb
CHANGED
@@ -29,15 +29,4 @@ module Pushpad
|
|
29
29
|
OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), self.auth_token, data.to_s)
|
30
30
|
end
|
31
31
|
|
32
|
-
def self.path(options = {})
|
33
|
-
project_id = options[:project_id] || self.project_id
|
34
|
-
raise "You must set project_id" unless project_id
|
35
|
-
"https://pushpad.xyz/projects/#{self.project_id}/subscription/edit"
|
36
|
-
end
|
37
|
-
|
38
|
-
def self.path_for(user, options = {})
|
39
|
-
uid = user.respond_to?(:id) ? user.id : user
|
40
|
-
uid_signature = self.signature_for(uid.to_s)
|
41
|
-
"#{self.path(options)}?uid=#{uid}&uid_signature=#{uid_signature}"
|
42
|
-
end
|
43
32
|
end
|
data/pushpad.gemspec
CHANGED
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.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pushpad
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.
|
85
|
+
rubygems_version: 2.5.2.3
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Web push notifications for Chrome, Firefox and Safari using Pushpad.
|