You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MIGRATION_GUIDE.md
+3-5Lines changed: 3 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -108,8 +108,6 @@ The current device’s push subscription can be retrieved via:
108
108
109
109
To receive push notifications on the device, call the push subscription’s `optIn` method. If needed, this method will prompt the user for push notifications permission.
110
110
111
-
Note: For greater control over prompting for push notification permission, you may use the `OneSignal.Notifications.requestPermission` method detailed below in the API Reference.
112
-
113
111
114
112
**Flutter**
115
113
```dart
@@ -223,12 +221,12 @@ The Push Subscription name space is accessible via `OneSignal.User.pushSubscript
223
221
|`var optedIn = OneSignal.User.pushSubscription.optedIn`|*Gets a boolean value indicating whether the current user is opted in to push notifications. This returns `true` when the app has notifications permission and `optedOut` is called. ***Note:*** Does not take into account the existence of the subscription ID and push token. This boolean may return `true` but push notifications may still not be received by the user.*|
224
222
|`OneSignal.User.pushSubscription.optIn();`|*Call this method to receive push notifications on the device or to resume receiving of push notifications after calling `optOut`. If needed, this method will prompt the user for push notifications permission.*|
225
223
|`OneSignal.User.pushSubscription.optOut();`|*If at any point you want the user to stop receiving push notifications on the current device (regardless of system-level permission status), you can call this method to opt out.*|
226
-
|`wOneSignal.User.pushSubscription.addObserver();`<br><br>***See below for usage***|*The `OSPushSubscriptionObserver.onOSPushSubscriptionChanged` method will be fired on the passed-in object when the push subscription changes. This method returns the current `OSPushSubscriptionState` at the time of adding this observer.*|
224
+
|`wOneSignal.User.pushSubscription.addObserver();`<br><br>***See below for usage***|*The `OneSignalPushSubscriptionObserver.onOSPushSubscriptionChangedWithState` method will be fired on the passed-in object when the push subscription changes. This method returns the current `OSPushSubscriptionState` at the time of adding this observer.*|
227
225
|`OneSignal.User.pushSubscription.removeObserver();`<br><br>***See below for usage***|*Remove a push subscription observer that has been previously added.*|
228
226
229
227
### Push Subscription Observer
230
228
231
-
Any object implementing the `OSPushSubscriptionObserver` protocol can be added as an observer. You can call `removeObserver` to remove any existing listeners.
229
+
Any object implementing the `OneSignalPushSubscriptionObserver` protocol can be added as an observer. You can call `removeObserver` to remove any existing listeners.
232
230
233
231
**Flutter**
234
232
```dart
@@ -259,7 +257,7 @@ The Notifications namespace is accessible via `OneSignal.Notifications` and prov
|`var permission = Notifications.permission`|*Whether this app has push notification permission.*|
262
-
|`var canRequest = await OneSignal.Notifications.canRequestPermission();`|*Whether attempting to request notification permission will show a prompt. Returns `true` if the device has not been prompted for push notification permission already.*|
260
+
|`var canRequest = await OneSignal.Notifications.canRequest();`|*Whether attempting to request notification permission will show a prompt. Returns `true` if the device has not been prompted for push notification permission already.*|
263
261
|`OneSignal.Notifications.clearAll();`|*Removes all OneSignal notifications.*|
264
262
|`OneSignal.Notifications.removeNotification(int x);`|*(Android only) Cancels a single OneSignal notification based on its Android notification integer ID. Use instead of Android's [android.app.NotificationManager.cancel], otherwise the notification will be restored when your app is restarted.*|
265
263
|`OneSignal.Notifications.removeGroupedNotifications("GROUP_KEY");`|*(Android only) Cancels a group of OneSignal notifications with the provided group key. Grouping notifications is a OneSignal concept, there is no [android.app.NotificationManager] equivalent.*|
0 commit comments