Skip to content

Commit 3f099a9

Browse files
committed
Migration guide updates
1 parent da680b1 commit 3f099a9

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

MIGRATION_GUIDE.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The OneSignal SDK has been updated to be more modular in nature. The SDK has bee
5050

5151
Initialization of the OneSignal SDK is now completed through the `initialize` method. A typical initialization now looks similar to below.
5252

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.
5454

5555
Replace the following:
5656

@@ -99,7 +99,7 @@ The current device’s push subscription can be retrieved via:
9999

100100
**Flutter**
101101
```dart
102-
var id = OneSignal.User.pushSubscription.optedIn;
102+
var id = OneSignal.User.pushSubscription.id;
103103
var token = OneSignal.User.pushSubscription.token;
104104
var optedIn = OneSignal.User.pushSubscription.optedIn;
105105
```
@@ -157,9 +157,9 @@ The SDK is still accessible via a `OneSignal` static class. It provides access t
157157
| `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.* |
158158
| `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].* |
159159
| `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.* |
163163

164164

165165

@@ -221,8 +221,8 @@ The Push Subscription name space is accessible via `OneSignal.User.pushSubscript
221221
| `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.* |
222222
| `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.* |
223223
| `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.* |
226226

227227
### Push Subscription Observer
228228

@@ -257,7 +257,7 @@ The Notifications namespace is accessible via `OneSignal.Notifications` and prov
257257
| **Flutter** | **Description** |
258258
|---------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|
259259
| `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.* |
261261
| `OneSignal.Notifications.clearAll();` | *Removes all OneSignal notifications.*|
262262
| `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.*|
263263
| `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
377377
378378
# Limitations
379379
**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.
381381
- Aliases will be available in a future release
382382
- Outcomes will be available in a future release
383383
- Users are deleted when the last Subscription (push, email, or sms) is removed
384384
- Any `User` namespace calls must be invoked **after** initialization. Example: `OneSignal.User.addTag("tag", "2")`
385385

386386
# Known issues
387387
- 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

Comments
 (0)