Skip to content

Commit 560b5bb

Browse files
authored
Merge pull request #1305 from OneSignal/update_migration_guide
Update migration guide
2 parents 21c52c1 + d7aeef0 commit 560b5bb

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

MIGRATION_GUIDE.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,28 @@ As mentioned above, the iOS SDK is making the jump from `v3` to `v5`, in order t
6060
```
6161

6262
### 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).
6468

6569
### 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).
6785

6886
# API Changes
6987
## Namespaces
@@ -99,7 +117,7 @@ Replace the following:
99117
OneSignal.initWithLaunchOptions(launchOptions)
100118
OneSignal.setAppId("YOUR_ONESIGNAL_APP_ID")
101119
```
102-
To the match the new initialization:
120+
To match the new initialization:
103121

104122
**Objective-C**
105123
```objc
@@ -109,6 +127,8 @@ To the match the new initialization:
109127
```swift
110128
OneSignal.initialize("YOUR_ONESIGNAL_APP_ID", withLaunchOptions: launchOptions)
111129
```
130+
Remove any usages of `setLaunchURLsInApp` as the method and functionality has been removed.
131+
112132
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.
113133

114134
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
227247
| `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.* |
228248
| `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].* |
229249
| `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.* |
250+
231251

232252

233253
## Live Activities

0 commit comments

Comments
 (0)