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
+10-12Lines changed: 10 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ The OneSignal SDK has been updated to be more modular in nature. The SDK has bee
50
50
51
51
Initialization of the OneSignal SDK is now completed through the `initialize` method. A typical initialization now looks similar to below.
52
52
53
-
Navigate to your index.ts file, or the first Javascript file that loads with your app.
53
+
Navigate to your main.dart file, or the first dart file that loads with your app.
54
54
55
55
Replace the following:
56
56
@@ -99,7 +99,7 @@ The current device’s push subscription can be retrieved via:
99
99
100
100
**Flutter**
101
101
```dart
102
-
var id = OneSignal.User.pushSubscription.optedIn;
102
+
var id = OneSignal.User.pushSubscription.id;
103
103
var token = OneSignal.User.pushSubscription.token;
104
104
var optedIn = OneSignal.User.pushSubscription.optedIn;
105
105
```
@@ -157,9 +157,9 @@ The SDK is still accessible via a `OneSignal` static class. It provides access t
157
157
| `OneSignal.shared.logout();` | *Logout the user previously logged in via [login]. The [user] property now references a new device-scoped user. A device-scoped user has no user identity that can later be retrieved, except through this device as long as the app remains installed and the app data is not cleared.* |
158
158
| `var consent = await OneSignal.shared.getPrivacyConsent();`<br><br>`OneSignal.shared.setPrivacyConsent(true);` | *Indicates whether privacy consent has been granted. This field is only relevant when the application has opted into data privacy protections. See [requiresPrivacyConsent].* |
159
159
| `OneSignal.shared.setRequiresPrivacyConsent(true);` | *Determines whether a user must consent to privacy prior to their user data being sent up to OneSignal. This should be set to `true` prior to the invocation of `initialize` to ensure compliance.* |
160
-
|`OneSignal.shared.setLaunchURLsInApp(true);`|*This method can be used to set if launch URLs should be opened in safari or within the application. Set to `true` to launch all notifications with a URL in the app instead of the default web browser. Make sure to call `setLaunchURLsInApp` before the `initialize` call.*|
161
-
| `OneSignal.shared.enterLiveActivity("ACTIVITY_ID", "TOKEN");`<br><br>***See below for usage of callbacks***|*Entering a Live Activity associates an `activityId` with a live activity temporary push `token` on OneSignal's server. The activityId is then used with the OneSignal REST API to update one or multiple Live Activities at one time.* |
162
-
| `OneSignal.shared.exitLiveActivity("ACTIVITY_ID");`<br><br>***See below for usage of callbacks*** |*Exiting a Live activity deletes the association between a customer defined `activityId` with a Live Activity temporary push `token` on OneSignal's server.* |
160
+
|`OneSignal.shared.setLaunchURLsInApp(true);`|*(iOS only) This method can be used to set if launch URLs should be opened in safari or within the application. Set to `true` to launch all notifications with a URL in the app instead of the default web browser. Make sure to call `setLaunchURLsInApp` before the `initialize` call.*|
161
+
| `OneSignal.shared.enterLiveActivity("ACTIVITY_ID", "TOKEN");`<br><br>***See below for usage of callbacks***|*(iOS only) Entering a Live Activity associates an `activityId` with a live activity temporary push `token` on OneSignal's server. The activityId is then used with the OneSignal REST API to update one or multiple Live Activities at one time.* |
162
+
| `OneSignal.shared.exitLiveActivity("ACTIVITY_ID");`<br><br>***See below for usage of callbacks*** |*(iOS only) Exiting a Live activity deletes the association between a customer defined `activityId` with a Live Activity temporary push `token` on OneSignal's server.* |
163
163
164
164
165
165
@@ -221,8 +221,8 @@ The Push Subscription name space is accessible via `OneSignal.User.pushSubscript
221
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.*|
222
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.*|
223
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.*|
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.*|
225
-
|`OneSignal.User.pushSubscription.removeObserver();`<br><br>***See below for usage***|*Remove a push subscription observer that has been previously added.*|
224
+
|`OneSignal.User.pushSubscription.addObserver(observer);`<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.*|
225
+
|`OneSignal.User.pushSubscription.removeObserver(observer);`<br><br>***See below for usage***|*Remove a push subscription observer that has been previously added.*|
226
226
227
227
### Push Subscription Observer
228
228
@@ -257,7 +257,7 @@ The Notifications namespace is accessible via `OneSignal.Notifications` and prov
|`var permission = Notifications.permission`|*Whether this app has push notification permission.*|
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.*|
260
+
|`var canRequest = await OneSignal.Notifications.canRequest();`| * (iOS only) Whether attempting to request notification permission will show a prompt. Returns `true` if the device has not been prompted for push notification permission already.*|
261
261
|`OneSignal.Notifications.clearAll();`|*Removes all OneSignal notifications.*|
262
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.*|
263
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.*|
@@ -377,14 +377,12 @@ The Debug namespace is accessible via `OneSignal.Debug` and provide access to de
377
377
378
378
# Limitations
379
379
**General**
380
-
-Recommend using only in development and staging environments for Alpha releases
380
+
-This is a Beta release so please test thorougly prior to production use.
381
381
- Aliases will be available in a future release
382
382
- Outcomes will be available in a future release
383
383
- Users are deleted when the last Subscription (push, email, or sms) is removed
384
384
- Any `User` namespace calls must be invoked **after** initialization. Example: `OneSignal.User.addTag("tag", "2")`
385
385
386
386
# Known issues
387
387
- Identity Verification
388
-
- We will be introducing JWT in a follow up Alpha or Beta release
389
-
- User properties may not update correctly when Subscriptions are transferred
390
-
- Please report any issues you find with this
388
+
- We will be introducing JWT in a follow up release
0 commit comments