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_v3_to_v5.md
+12-11Lines changed: 12 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ The OneSignal SDK has been updated to be more modular in nature. The SDK has be
48
48
Initialization of the OneSignal SDK, although similar to past versions, has changed. The target OneSignal application (`appId`) is now provided as part of initialization and cannot be changed post-initialization. A typical initialization now looks similar to below
49
49
50
50
OneSignal.Default.Initialize(ONESIGNAL_APP_ID);
51
-
// requestPermission will show the native platform notification permission prompt.
51
+
// RequestPermissionAsync will show the native platform notification permission prompt.
52
52
// We recommend removing the following code and instead using an In-App Message to prompt for notification permission.
53
53
var result = await OneSignal.Default.Notifications.RequestPermissionAsync(true);
54
54
@@ -115,7 +115,7 @@ The SDK is still accessible via a `OneSignal.Default` static class, it provides
115
115
|`bool ConsentGiven`|*Indicates whether privacy consent has been granted. This field is only relevant when the application has opted into data privacy protections. See [ConsentRequired].*|
116
116
|`void Initialize(string appId)`|*Initialize the OneSignal SDK. This should be called during startup of the application.*|
117
117
| `void Login(string externalId, string jwtBearerToken = null)` | *Login to OneSignal under the user identified by the [externalId] provided. The act of logging a user into the OneSignal SDK will switch the [user] context to that specific user.*<br><br>- *If the [externalId] exists the user will be retrieved and the context set from that user information. If operations have already been performed under a guest user, they* ***will not*** *be applied to the now logged in user (they will be lost).*<br>- *If the [externalId] does not exist the user will be created and the context set from the current local state. If operations have already been performed under a guest user those operations* ***will*** *be applied to the newly created user.*<br><br>***Push Notifications and In App Messaging***<br>*Logging in a new user will automatically transfer push notification and in app messaging subscriptions from the current user (if there is one) to the newly logged in user. This is because both Push and IAM are owned by the device.* |
118
-
|`void 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.*|
118
+
|`void 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.*|
119
119
|`void SetLaunchURLsInApp(bool launchInApp)`|***Note:****This method is for iOS only<br>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.*|
120
120
121
121
@@ -126,7 +126,7 @@ The user name space is accessible via `OneSignal.Default.User` and provides acce
|`IPushSubscription PushSubscription`|*The push subscription associated to the current user.*|
128
128
|`string Language`|*Set the 2-character language either as a detected language or explicitly set for this user.*|
129
-
|`PushSubsription.Changed` <br><br> `event EventHandler<PushSubscriptionChangedEventArgs> Changed` <br><br> `PushSubscriptionChangedEventArgs { PushSubscriptionChangedState State }`|*Adds a change event that will run whenever the push subscription has been changed.*|
129
+
|`PushSubsription.Changed` <br><br> `event EventHandler<PushSubscriptionChangedEventArgs> Changed` <br><br> `PushSubscriptionChangedEventArgs { PushSubscriptionChangedState State }`|*Adds a change event that will run whenever the push subscription has been changed.*|
130
130
|`void AddAlias(string label, string id)`|*Set an alias for the current user. If this alias already exists it will be overwritten.*|
131
131
|`void AddAliases(Dictionary<string, string> aliases)`| S*et aliases for the current user. If any alias already exists it will be overwritten.*|
132
132
|`void RemoveAlias(string label)`|*Remove an alias from the current user.*|
@@ -154,14 +154,15 @@ The session namespace is accessible via `OneSignal.Default.Session` and provides
154
154
**Notifications Namespace**
155
155
The notification namespace is accessible via `OneSignal.Default.Notifications` and provides access to notification-scoped functionality.
|`bool Permission`|*Whether this app has push notification permission.*|
160
+
|`NotificationPermission PermissionNative`|*Native permission of the device. The enum NotificationPermission can be NotDetermined, Denied, Authorized, Provisional, or Ephemeral.*|
160
161
|`Task<bool> RequestPermissionAsync(bool fallbackToSettings)`|*Prompt the user for permission to push notifications. This will display the native OS prompt to request push notification permission. If the user enables, a push subscription to this device will be automatically added to the user.*|
161
162
|`void ClearAllNotifications()`|*Removes all OneSignal notifications.*|
162
163
|`event EventHandler<NotificationPermissionChangedEventArgs> PermissionChanged` <br><br> `NotificationPermissionChangedEventArgs { bool Permission }`|*The [PermissionChanged] event will be fired when a notification permission setting changes. This happens when the user enables or disables notifications for your app from the system settings outside of your app.*|
163
-
|`event EventHandler<NotificationWillDisplayEventArgs> ForegroundWillDisplay` <br><br> `NotificationWillDisplayEventArgs { IDisplayableNotification Notification, void PreventDefault() }`|*Set an event to fire before displaying a notification while the app is in focus. Use this event to read notification data or decide if the notification should show or not.*|
164
-
|`event EventHandler<NotificationClickEventArgs> Clicked` <br><br> `NotificationClickEventArgs { INotification Notification, INotificationClickResult Result }`|*Set an event that will fire whenever a notification is clicked on by the user.*|
164
+
|`event EventHandler<NotificationWillDisplayEventArgs> ForegroundWillDisplay` <br><br> `NotificationWillDisplayEventArgs { IDisplayableNotification Notification, void PreventDefault() }`|*Set an event to fire before displaying a notification while the app is in focus. Use this event to read notification data or decide if the notification should show or not.*|
165
+
|`event EventHandler<NotificationClickEventArgs> Clicked` <br><br> `NotificationClickEventArgs { INotification Notification, INotificationClickResult Result }`|*Set an event that will fire whenever a notification is clicked on by the user.*|
165
166
166
167
167
168
**Location Namespace**
@@ -184,8 +185,8 @@ The In App Messages namespace is accessible via `OneSignal.Default.InAppMessages
184
185
|`void RemoveTrigger(string key)`|*Remove the trigger with the provided key from the current user.*|
185
186
|`void RemoveTriggers(params string[] keys)`|*Remove multiple triggers from the current user.*|
186
187
|`void ClearTriggers()`|*Clear all triggers from the current user.*|
|`event EventHandler<InAppMessageClickEventArgs> Clicked` <br><br> `InAppMessageClickEventArgs { IInAppMessage Message, IInAppMessageClickResult Result }`|*Set the IAM click events.*|
|`event EventHandler<InAppMessageClickEventArgs> Clicked` <br><br> `InAppMessageClickEventArgs { IInAppMessage Message, IInAppMessageClickResult Result }`|*Set the IAM click events.*|
189
190
190
191
191
192
**LiveActivities Namespace**
@@ -215,5 +216,5 @@ The debug namespace is accessible via `OneSignal.Default.Debug` and provides acc
215
216
- We will be introducing JWT in follow up Beta release
216
217
217
218
# Troubleshooting
218
-
-`Assets/OneSignal/Example/OneSignalExampleBehaviou.cs error : The type or namespace name '...`
219
-
- Delete the directory at `Assets/OneSignal` and the xml file at `Assets/Plugins/Android/OneSignalConfig.plugin/AndroidManifest.xml`
219
+
`Assets/OneSignal/Example/OneSignalExampleBehaviou.cs: error CS0246: The type or namespace name '...' cound not be found (are you missing a using directive or an assembly reference?)`
220
+
- Delete the directory at `Assets/OneSignal` and the xml file at `Assets/Plugins/Android/OneSignalConfig.plugin/AndroidManifest.xml`
0 commit comments