onsignal 5.0.0 → 5.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0dd60aab5dd2f9f314707ff831ef5daa5b5a001eddb01373ea45146354469150
4
- data.tar.gz: c7e6bf9704c846825fdedb473aa21d692c7a3a33dd375055dc634a47723ee51b
3
+ metadata.gz: 0b865e3b6c4d7ecfdd69ba9bc1879a18813173b5bbeb06d7e310e0869401998f
4
+ data.tar.gz: db5b20fa14141fec8aa2fcd281c6b0d172d49ab4ed232fa6e82b5b76a6523125
5
5
  SHA512:
6
- metadata.gz: cba30256ba8470dcec04dc3fce6332e9191bf1d425d0e4d1cca3c74cdbb3017a0d4a409cff89259709da2fb202869ef24695866cc3ed1c5217492604f3a113f5
7
- data.tar.gz: 514059dc5200cee8adba10b81bdf7af50a666cbf33c25daeb69cf03a5be53f63fa442baf0f1899d4ecac519f216ab5c7943fb8d9c350cf17bd37f8fdd5d21c9b
6
+ metadata.gz: 9550f4885061e370214831561b2e3c87d0d77cdd109ce55801bd0a272369785b3bc1a7d23c97e5fdf54c493b336c0205802d0bb5113a691ac30122d5a97bc019
7
+ data.tar.gz: e5a8b6dd0a20162b47e44ad7e4a08f783979d7606f2dd82c561032fe2f7034bb1c5fc81d992a9455f28522be8010ac9bea3e569786dad6ccab5b83c066a9bb81
@@ -4,6 +4,11 @@
4
4
 
5
5
  * nothing yet
6
6
 
7
+ ### 5.0.1 - 2018/02/19
8
+
9
+ * bugfixes
10
+ * fixed `undefined local variable or method 'set_onesignal_user'`
11
+
7
12
  ### 5.0.0 - 2018/02/09
8
13
 
9
14
  * features
data/README.md CHANGED
@@ -38,19 +38,23 @@ Handle user subscriptions to OneSignal in your frontend code.
38
38
  ### Overview
39
39
 
40
40
  ```javascript
41
+ import 'onsignal/dist/OneSignalSDK';
41
42
  import OnSignal from 'onsignal';
42
- let onSignal = new OnSignal( 'OneSignal App ID', {
43
- autoRegister: false
44
- });
45
43
 
46
- // Object to call OneSignal API from
47
- onSignal.oneSignal;
44
+ document.addEventListener( 'ready', () => {
45
+ const onSignal = new OnSignal( 'OneSignal App ID', {
46
+ autoRegister: false
47
+ });
48
48
 
49
- // Current users player ID
50
- onSignal.playerId;
49
+ // Object to call OneSignal API from
50
+ onSignal.oneSignal;
51
51
 
52
- // Current users permission
53
- onSignal.permission;
52
+ // Current users player ID
53
+ onSignal.playerId;
54
+
55
+ // Current users permission
56
+ onSignal.permission;
57
+ };
54
58
  ```
55
59
 
56
60
  #### Options
@@ -58,7 +62,7 @@ onSignal.permission;
58
62
  Pass options to OneSignal's `push(['init', {...}])` function as a hash. Default values are:
59
63
 
60
64
  * `autoRegister` Automatically try to subscribe the user when loading a page. Accepts a boolean. Defaults to `false`.
61
- * `persistNotification` Automatically dismiss notifications after ~20 seconds in Chrome Desktop v47+. Accepts a boolean. Defaults to `false`.
65
+ * `persistNotification` If set to `false `, automatically dismisses notifications after ~20 seconds in Chrome Desktop v47+. Accepts a boolean. Defaults to `false`.
62
66
  * `welcomeNotification` Hash configuring the default OneSignal welcome notification. Accepts a hash. Defaults to `{ disable: true }`.
63
67
  * `notifyButton` Hash configuring the default OneSignal notify button at the bottom right of the screen. Accepts a hash. Defaults to `{ enable: false }`.
64
68
 
@@ -131,7 +135,7 @@ class Admin < ApplicationRecord
131
135
  end
132
136
  ```
133
137
 
134
- Next attach a user object by defining a `set_onsignal_user` method. Let's say model is named `Admin` and `current_admin` is available at controller level. Just add a method to your `ApplicationController`:
138
+ Next attach a user object by defining a `set_onsignal_user` method. Let's say model our is named `Admin` and `current_admin` is available at controller level. Just add a method to your `ApplicationController`:
135
139
 
136
140
  ```ruby
137
141
  def set_onsignal_user
@@ -18,7 +18,7 @@ module OnSignalController
18
18
  device = OnSignal.configuration.device_const.constantize.find_or_create_by! onesignal_id: onesignal_player_id
19
19
  device.onesignal_permission = cookies[:oneSignalPlayerPermission]
20
20
  device.last_used = Time.now
21
- device.owner = set_onesignal_user
21
+ device.owner = set_onsignal_user
22
22
  device.save!
23
23
  end
24
24
  end
@@ -1,5 +1,5 @@
1
1
  module OnSignal
2
2
 
3
- VERSION = '5.0.0'
3
+ VERSION = '5.0.1'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.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: 2018-02-09 00:00:00.000000000 Z
11
+ date: 2018-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -135,28 +135,7 @@ homepage: https://github.com/jonhue/onsignal
135
135
  licenses:
136
136
  - MIT
137
137
  metadata: {}
138
- post_install_message: |
139
- **Thank you for installing OnSignal!**
140
-
141
-
142
- There are four wo more steps to take:
143
-
144
- 1) Run `rails g devise_onesignal` and `rails db:migrate`
145
- 2) Enter your OneSignal App ID in config/initializers/devise-onesignal.rb
146
- 3) Add:
147
-
148
- import 'devise-onesignal/dist/OneSignalSDK';
149
- import * as deviseOneSignal from 'devise-onesignal';
150
-
151
- to your webpack pack in app/javascript/packs/application.js
152
- 4) Add:
153
-
154
- has_devices
155
-
156
- to your authentication model
157
-
158
-
159
- Learn more at https://github.com/jonhue/devise-onesignal
138
+ post_install_message:
160
139
  rdoc_options: []
161
140
  require_paths:
162
141
  - lib