devise-onesignal 2.0.0 → 2.0.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/CHANGELOG.md +5 -0
- data/README.md +10 -6
- data/lib/devise-onesignal/device_concern.rb +1 -1
- data/lib/devise-onesignal/device_helper.rb +1 -1
- data/lib/devise-onesignal/device_lib.rb +3 -3
- data/lib/devise-onesignal/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 107a9075cb4ba1e6aa859142f8ad429ef18470f32bc515b754e522c96b4771e8
|
4
|
+
data.tar.gz: 513f23e8a4ca0a60f7535c0e5e68f43f1c8421ed368e86e76cea524b4ab0784a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a523ec599d55ab9c7a3bcc35210dfaf9a2f43c6934589ac174a10cd9b6b2a1b8995a369a5eb0d20305ddf2b0d7e02a2dbd08e0c7743a09be0e75a77c68bb0eb2
|
7
|
+
data.tar.gz: 68cc49c37097dfef72fce53965c54413474aaf7577b940f7526d01d2575b0244e524eb0461db5c6e79da4ea624d9c9398568aefd9a4b3e7515ced9d4335034bb
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -125,7 +125,7 @@ Just call `OneSignalSubscribe();` in your frontend code and OneSignal will ask y
|
|
125
125
|
|
126
126
|
**Note:** You most likely don't want to let your users unsubscribe from receiving notifications, but instead allow them to manually disable receiving any new notifications. For that purpose use the [notifications-rails](https://github.com/jonhue/notifications-rails) gem, which adds a notification API and detailed user settings.
|
127
127
|
|
128
|
-
If you want to completely remove a user from OneSignal, call `
|
128
|
+
If you want to completely remove a user from OneSignal, call `OneSignalUnsubscribe();` in your javascript.
|
129
129
|
|
130
130
|
---
|
131
131
|
|
@@ -139,11 +139,15 @@ DeviseOnesignal.configure do |config|
|
|
139
139
|
end
|
140
140
|
```
|
141
141
|
|
142
|
-
**`app_id` (required)** Your OneSignal app id. Create one here: https://onesignal.com
|
143
|
-
|
144
|
-
**`
|
145
|
-
|
146
|
-
**`
|
142
|
+
**`app_id` (required)** Your OneSignal app id. Takes a string. Create one here: https://onesignal.com
|
143
|
+
|
144
|
+
**`devise_class`** Specify your devise class. Takes a string. Defaults to `'User'`.
|
145
|
+
|
146
|
+
**`auto_register`** Automatically try to subscribe the user when loading a page. Takes a boolean. Defaults to `false`.
|
147
|
+
|
148
|
+
**`persist_notification`** Automatically dismiss the notification after ~20 seconds in Chrome. Takes a boolean. Defaults to `false`.
|
149
|
+
|
150
|
+
**`subscribe_with_modal`** Show a modal instead of a native browser window when subscribing a user to OneSignal. Takes a boolean. Defaults to `false`.
|
147
151
|
|
148
152
|
---
|
149
153
|
|
@@ -16,7 +16,7 @@ module DeviseOnesignal
|
|
16
16
|
onesignal_user_id = cookies[:oneSignalUserId]
|
17
17
|
device = Device.find_or_create_by! onesignal_id: onesignal_user_id
|
18
18
|
device.user = current_user if current_user
|
19
|
-
device.
|
19
|
+
device.onesignal_permission = cookies[:oneSignalUserPermission]
|
20
20
|
device.last_used = Time.now
|
21
21
|
device.save!
|
22
22
|
end
|
@@ -5,7 +5,7 @@ module DeviseOnesignal
|
|
5
5
|
if cookies[:oneSignalUserId].nil?
|
6
6
|
device = Device.new
|
7
7
|
device.user = current_user if current_user
|
8
|
-
device.
|
8
|
+
device.onesignal_permission = cookies[:oneSignalUserPermission]
|
9
9
|
device.last_used = Time.now
|
10
10
|
else
|
11
11
|
device = Device.find_by(onesignal_id: cookies[:oneSignalUserId])
|
@@ -2,13 +2,13 @@ module DeviseOnesignal
|
|
2
2
|
module DeviceLib
|
3
3
|
|
4
4
|
def onesignal_enabled?
|
5
|
-
self.
|
5
|
+
self.onesignal_permission == 'granted'
|
6
6
|
end
|
7
7
|
def onesignal_disabled?
|
8
|
-
self.
|
8
|
+
self.onesignal_permission == 'denied'
|
9
9
|
end
|
10
10
|
def onesignal_set?
|
11
|
-
!self.
|
11
|
+
!self.onesignal_permission == 'default'
|
12
12
|
end
|
13
13
|
|
14
14
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise-onesignal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
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-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|