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
+24-4Lines changed: 24 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,10 +60,28 @@ As mentioned above, the iOS SDK is making the jump from `v3` to `v5`, in order t
60
60
```
61
61
62
62
### Option 1. Swift Package Manager
63
-
Update the version of the OneSignal-XCFramework your application uses to `5.0.0`. In addition, the Package Product name has been changed from `OneSignal` to `OneSignalFramework`. See [the existing installation instructions](https://documentation.onesignal.com/docs/swift-package-manager-setup).
63
+
- Update the version of the OneSignal-XCFramework your application uses to `5.0.0`.
64
+
- The Package Product `OneSignal` has been renamed to `OneSignalFramework`.
65
+
- Location functionality has moved to its own Package Product `OneSignalLocation`. If you do not explicitly add this product your app you will not have location functionality. If you include location functionality ensure that your app also depends on the `CoreLocation` framework.
66
+
- In App Messaging functionality has moved to its own Package Product `OneSignalInAppMessages`. If you do not explicitly add this product your app you will not have in app messaging functionality. If you include In App Messaging functionality ensure that your app also depends on the `WebKit` framework.
67
+
- See [the existing installation instructions](https://documentation.onesignal.com/docs/swift-package-manager-setup).
64
68
65
69
### Option 2. CocoaPods
66
-
Update the version of the OneSignalXCFramework your application uses to `5.0.0`. Other than updating the import statement above, there are no additional changes needed to import the OneSignal SDK in your Xcode project. See [the existing installation instructions](https://documentation.onesignal.com/docs/ios-sdk-setup#step-3-import-the-onesignal-sdk-into-your-xcode-project).
70
+
The OneSignal pod has added additional subspecs for improved modularity. If you would like to exclude Location or In App Messaging functionality from your app you can do so by using subspecs:
71
+
```
72
+
pod 'OneSignal/OneSignal', '>= 5.0.0', '< 6.0'
73
+
# Remove either of the following if the functionality is unwanted
74
+
pod 'OneSignal/OneSignalLocation', '>= 5.0.0', '< 6.0'
75
+
pod 'OneSignal/OneSignalInAppMessages', '>= 5.0.0', '< 6.0'
76
+
```
77
+
If you would like to include all of OneSignal's functionality you are still able to use the default pod
78
+
```
79
+
pod 'OneSignal', '>= 5.0.0', '< 6.0'
80
+
```
81
+
- Update the version of the OneSignalXCFramework your application uses to `5.0.0`.
82
+
- Location functionality has moved to its own subspec `OneSignalLocation`. If you include location functionality ensure that your app also depends on the `CoreLocation` framework.
83
+
- In App Messaging functionality has moved to its own subspec `OneSignalInAppMessages`. If you include In App Messaging functionality ensure that your app also depends on the `WebKit` framework.
84
+
- See [the existing installation instructions](https://documentation.onesignal.com/docs/ios-sdk-setup#step-3-import-the-onesignal-sdk-into-your-xcode-project).
67
85
68
86
# API Changes
69
87
## Namespaces
@@ -99,7 +117,7 @@ Replace the following:
99
117
OneSignal.initWithLaunchOptions(launchOptions)
100
118
OneSignal.setAppId("YOUR_ONESIGNAL_APP_ID")
101
119
```
102
-
To the match the new initialization:
120
+
To match the new initialization:
103
121
104
122
**Objective-C**
105
123
```objc
@@ -109,6 +127,8 @@ To the match the new initialization:
Remove any usages of `setLaunchURLsInApp` as the method and functionality has been removed.
131
+
112
132
If your integration is **not** user-centric, there is no additional startup code required. A device-scoped user *(please see definition of “**device-scoped user**” below in Glossary)* is automatically created as part of the push subscription creation, both of which are only accessible from the current device or through the OneSignal dashboard.
113
133
114
134
If your integration is user-centric, or you want the ability to identify the user beyond the current device, the `login` method should be called to identify the user:
@@ -227,7 +247,7 @@ The SDK is still accessible via a `OneSignal` static class. It provides access t
227
247
| `OneSignal.logout()` | `[OneSignal 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. Note that if the current user is already a device-scoped user at the time `logout` is called, this will result in a no-op and the SDK will continue using the same device-scoped user. Any state that exists on this device-scoped user will be kept. This also means that calling `logout` multiple times will have no effect.* |
228
248
| `OneSignal.setConsentGiven(true)` | `[OneSignal setConsentGiven:true]` | *Indicates whether privacy consent has been granted. This field is only relevant when the application has opted into data privacy protections. See [setConsentRequired].* |
229
249
| `OneSignal.setConsentRequired(true)` | `[OneSignal setConsentRequired: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.* |
230
-
|`OneSignal.setLaunchURLsInApp(true)`|`[OneSignal 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.*|
0 commit comments