pusher-push-notifications 0.1.1 → 0.2.1
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/.coveralls.yml +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +13 -16
- data/lib/pusher/push_notifications.rb +2 -2
- data/lib/pusher/push_notifications/use_cases/{notify.rb → publish.rb} +2 -2
- data/lib/pusher/push_notifications/version.rb +1 -1
- data/pusher-push-notifications.gemspec +4 -5
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6ff4e86ac0167280f704f95a610bfbd31c64627737b59a2a9b5878478274948
|
4
|
+
data.tar.gz: c851cab622b3308cbafef96e3a789e7810dfe4a6c80d5096495e9226fdd33bb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bf6832119bb99c1e6737b641d601d205e1c10dc3b507318d9cd000d1e3b84bd7d8af990aeeb7a007c9c4352df0a565797ec57d6becb5e5674c90e1557211e4c
|
7
|
+
data.tar.gz: 783a9e20816c8968ccbf09ffa3a8514c515e04202acd6c5d536ee5f49ffe8e64460b07f4a4e3c622e98a8e380fe53b9d1cd845bf6a0045451f8e35ebd4284d62
|
data/.coveralls.yml
CHANGED
@@ -1 +1 @@
|
|
1
|
-
repo_token:
|
1
|
+
repo_token: uaAoIkOEP9l7PCLENpJSSVVrcm94JDNYO
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,17 +1,16 @@
|
|
1
|
-
#
|
1
|
+
# Pusher Push Notifications Ruby Server SDK
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
## Getting started
|
3
|
+
[](https://travis-ci.org/pusher/push-notifications-ruby) [](https://coveralls.io/github/pusher/push-notifications-ruby?branch=master)
|
6
4
|
|
7
|
-
|
8
|
-
With an account created you can create a new push notification instance (you will need to upload the apns certificates for apple and the server keys for Google's Firebase Cloud Messaging). Also you will need the `instance id` and `secret key` so the gem can be configured properly.
|
9
|
-
|
10
|
-
**NOTE**: The official Pusher [gem](https://github.com/pusher/pusher-http-ruby) currently does not support push notifications (probably because they moved it to another dashboard), you need to rely on the WEB API (that's why this gem was created).
|
5
|
+
Push notifications using the Pusher system.
|
11
6
|
|
12
7
|
## Installation
|
13
8
|
|
14
|
-
|
9
|
+
```bash
|
10
|
+
gem install pusher-push-notifications
|
11
|
+
```
|
12
|
+
|
13
|
+
Or add this line to your application's Gemfile:
|
15
14
|
|
16
15
|
```ruby
|
17
16
|
gem 'pusher-push-notifications'
|
@@ -23,7 +22,7 @@ This configuration can be done anywhere you want, but if you are using rails the
|
|
23
22
|
|
24
23
|
```ruby
|
25
24
|
Pusher::PushNotifications.configure do |config|
|
26
|
-
config.instance_id = ENV['PUSHER_INSTANCE_ID'] # or the value directly
|
25
|
+
config.instance_id = ENV['PUSHER_INSTANCE_ID'] # or the value directly
|
27
26
|
config.secret_key = ENV['PUSHER_SECRET_KEY']
|
28
27
|
end
|
29
28
|
```
|
@@ -52,7 +51,7 @@ data = {
|
|
52
51
|
}
|
53
52
|
}
|
54
53
|
|
55
|
-
Pusher::PushNotifications.
|
54
|
+
Pusher::PushNotifications.publish(interests: ['hello'], payload: data)
|
56
55
|
```
|
57
56
|
|
58
57
|
The return of this call is a ruby struct containing the http status code (`status`) the response body (`content`) and an `ok?` attribute saying if the notification was successful or not.
|
@@ -70,10 +69,6 @@ HTTP Status | Reason
|
|
70
69
|
404 | Instance not found
|
71
70
|
500 | Internal server error
|
72
71
|
|
73
|
-
## TODO
|
74
|
-
|
75
|
-
Add an optional parameter containing the webhook url to be send together with the payload.
|
76
|
-
|
77
72
|
## Development
|
78
73
|
|
79
74
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -82,7 +77,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
82
77
|
|
83
78
|
## Contributing
|
84
79
|
|
85
|
-
|
80
|
+
- Found a bug? Please open an [issue](https://github.com/pusher/push-notifications-ruby/issues).
|
81
|
+
- Have a feature request. Please open an [issue](https://github.com/pusher/push-notifications-ruby/issues).
|
82
|
+
- If you want to contribute, please submit a [pull request](https://github.com/pusher/push-notifications-ruby/pulls) (preferrably with some tests).
|
86
83
|
|
87
84
|
## License
|
88
85
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'caze'
|
4
4
|
|
5
5
|
require_relative './push_notifications/client'
|
6
|
-
require_relative './push_notifications/use_cases/
|
6
|
+
require_relative './push_notifications/use_cases/publish'
|
7
7
|
require_relative './push_notifications/version'
|
8
8
|
|
9
9
|
module Pusher
|
@@ -12,7 +12,7 @@ module Pusher
|
|
12
12
|
|
13
13
|
class PushError < RuntimeError; end
|
14
14
|
|
15
|
-
has_use_case :
|
15
|
+
has_use_case :publish, UseCases::Publish
|
16
16
|
|
17
17
|
class << self
|
18
18
|
attr_reader :instance_id, :secret_key
|
@@ -5,10 +5,10 @@ require 'caze'
|
|
5
5
|
module Pusher
|
6
6
|
module PushNotifications
|
7
7
|
module UseCases
|
8
|
-
class
|
8
|
+
class Publish
|
9
9
|
include Caze
|
10
10
|
|
11
|
-
export :call, as: :
|
11
|
+
export :call, as: :publish
|
12
12
|
|
13
13
|
def initialize(interests:, payload: {})
|
14
14
|
@interests = interests
|
@@ -8,12 +8,11 @@ require 'pusher/push_notifications/version'
|
|
8
8
|
Gem::Specification.new do |spec|
|
9
9
|
spec.name = 'pusher-push-notifications'
|
10
10
|
spec.version = Pusher::PushNotifications::VERSION
|
11
|
-
spec.authors = ['Lucas Medeiros', '
|
12
|
-
spec.email = ['lucastoc@gmail.com', '
|
11
|
+
spec.authors = ['Lucas Medeiros', 'Pusher']
|
12
|
+
spec.email = ['lucastoc@gmail.com', 'support@pusher.com']
|
13
13
|
|
14
|
-
spec.summary = '
|
15
|
-
spec.
|
16
|
-
spec.homepage = 'https://github.com/lucasmedeirosleite/push-notifications-ruby'
|
14
|
+
spec.summary = 'Pusher Push Notifications Ruby server SDK'
|
15
|
+
spec.homepage = 'https://github.com/pusher/push-notifications-ruby'
|
17
16
|
spec.license = 'MIT'
|
18
17
|
|
19
18
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pusher-push-notifications
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucas Medeiros
|
8
|
-
-
|
8
|
+
- Pusher
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-02-
|
12
|
+
date: 2018-02-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: caze
|
@@ -183,10 +183,10 @@ dependencies:
|
|
183
183
|
- - ">="
|
184
184
|
- !ruby/object:Gem::Version
|
185
185
|
version: 3.0.1
|
186
|
-
description:
|
186
|
+
description:
|
187
187
|
email:
|
188
188
|
- lucastoc@gmail.com
|
189
|
-
-
|
189
|
+
- support@pusher.com
|
190
190
|
executables: []
|
191
191
|
extensions: []
|
192
192
|
extra_rdoc_files: []
|
@@ -207,10 +207,10 @@ files:
|
|
207
207
|
- lib/pusher.rb
|
208
208
|
- lib/pusher/push_notifications.rb
|
209
209
|
- lib/pusher/push_notifications/client.rb
|
210
|
-
- lib/pusher/push_notifications/use_cases/
|
210
|
+
- lib/pusher/push_notifications/use_cases/publish.rb
|
211
211
|
- lib/pusher/push_notifications/version.rb
|
212
212
|
- pusher-push-notifications.gemspec
|
213
|
-
homepage: https://github.com/
|
213
|
+
homepage: https://github.com/pusher/push-notifications-ruby
|
214
214
|
licenses:
|
215
215
|
- MIT
|
216
216
|
metadata: {}
|
@@ -230,8 +230,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
230
|
version: '0'
|
231
231
|
requirements: []
|
232
232
|
rubyforge_project:
|
233
|
-
rubygems_version: 2.7.
|
233
|
+
rubygems_version: 2.7.6
|
234
234
|
signing_key:
|
235
235
|
specification_version: 4
|
236
|
-
summary:
|
236
|
+
summary: Pusher Push Notifications Ruby server SDK
|
237
237
|
test_files: []
|