notification-pusher-onesignal 1.0.0 → 1.1.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/CHANGELOG.md +5 -12
- data/README.md +7 -3
- data/lib/notification_pusher/one_signal.rb +18 -16
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3781ed8426153ae28155f6c4ac202fb04f71ad7087192120f8fccc90c112d13b
|
4
|
+
data.tar.gz: 453695af13ba66f4e3d4136a6bc2e3319ff78b54e2a9d3fb3352c3d7fc8dc4f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77b227701f7cd1ca2ccdaa481c6c60abffbae871664be5a788586f988eab7b3b2df778b563203527a11bf06c345af1ab9062b57d4111c88faf232db3ae9beb06
|
7
|
+
data.tar.gz: 8590ed4dade6216890853922fb494debfa306b9eb584db366104524a5eee4f866bbda1510f07fe101ca0b9b721cb6fc01b0773fbd45c80b8be645d454804fb74
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,11 @@
|
|
4
4
|
|
5
5
|
* nothing yet
|
6
6
|
|
7
|
+
### 1.1.0 - 2017-12-29
|
8
|
+
|
9
|
+
* features
|
10
|
+
* add `headers` and `subtitle` options
|
11
|
+
|
7
12
|
### 1.0.0 - 2017-12-28
|
8
13
|
|
9
14
|
* bugfixes
|
@@ -13,23 +18,11 @@
|
|
13
18
|
* bugfixes
|
14
19
|
* fix lib loading problems
|
15
20
|
|
16
|
-
### 1.0.0.beta5 - 2017-12-28
|
17
|
-
|
18
|
-
* no changes
|
19
|
-
|
20
21
|
### 1.0.0.beta4 - 2017-12-27
|
21
22
|
|
22
23
|
* features
|
23
24
|
* add functionality
|
24
25
|
|
25
|
-
### 1.0.0.beta3 - 2017-12-25
|
26
|
-
|
27
|
-
* no changes
|
28
|
-
|
29
|
-
### 1.0.0.beta2 - 2017-12-23
|
30
|
-
|
31
|
-
* no changes
|
32
|
-
|
33
26
|
### 1.0.0.beta1 - 2017-12-22
|
34
27
|
|
35
28
|
* initial release
|
data/README.md
CHANGED
@@ -72,9 +72,9 @@ You can also store OneSignal information in your notification opposed to specify
|
|
72
72
|
|
73
73
|
```ruby
|
74
74
|
notification.metadata[:onesignal_url] = Rails.application.routes.url_helpers.root_url
|
75
|
-
notification.metadata[:onesignal_contents] = {
|
76
|
-
|
77
|
-
}
|
75
|
+
notification.metadata[:onesignal_contents] = { en: 'My notification content' }
|
76
|
+
notification.metadata[:onesignal_headers] = { en: 'My notification header' }
|
77
|
+
notification.metadata[:onesignal_subtitle] = { en: 'My notification subtitle' }
|
78
78
|
notification.save
|
79
79
|
notification.push :OneSignal, player_ids: User.first.onesignal_player_ids
|
80
80
|
```
|
@@ -92,6 +92,10 @@ notification.push :OneSignal, player_ids: User.first.onesignal_player_ids
|
|
92
92
|
|
93
93
|
**`contents`** Globalized content of the notification. Takes a hash with languages as keys and strings as values.
|
94
94
|
|
95
|
+
**`headings`** Globalized header of the notification. Takes a hash with languages as keys and strings as values.
|
96
|
+
|
97
|
+
**`subtitle`** Globalized subtitle of the notification. Takes a hash with languages as keys and strings as values.
|
98
|
+
|
95
99
|
---
|
96
100
|
|
97
101
|
## To Do
|
@@ -1,16 +1,18 @@
|
|
1
|
-
require 'one_signal'
|
2
|
-
|
3
|
-
class NotificationPusher::OneSignal
|
4
|
-
|
5
|
-
def initialize notification, options = {}
|
6
|
-
if options[:player_ids].any?
|
7
|
-
::OneSignal::Notification.create params: {
|
8
|
-
app_id: options[:app_id],
|
9
|
-
url: options[:url] || notification.metadata[:onesignal_url],
|
10
|
-
contents: options[:contents] || notification.metadata[:onesignal_contents].to_h,
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
1
|
+
require 'one_signal'
|
2
|
+
|
3
|
+
class NotificationPusher::OneSignal
|
4
|
+
|
5
|
+
def initialize notification, options = {}
|
6
|
+
if options[:player_ids].any?
|
7
|
+
::OneSignal::Notification.create params: {
|
8
|
+
app_id: options[:app_id],
|
9
|
+
url: options[:url] || notification.metadata[:onesignal_url],
|
10
|
+
contents: options[:contents] || notification.metadata[:onesignal_contents].to_h,
|
11
|
+
headers: options[:headers] || notification.metadata[:onesignal_headers].to_h,
|
12
|
+
subtitle: options[:subtitle] || notification.metadata[:onesignal_subtitle].to_h,
|
13
|
+
include_player_ids: options[:player_ids]
|
14
|
+
}, opts: { auth_key: options[:auth_key] }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notification-pusher-onesignal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Hübotter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: one_signal
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.1.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|