|
| 1 | +<h1 align="center">OneSignal SDK v5.0.0-alpha1 Migration Guide</h1> |
| 2 | + |
| 3 | + |
| 4 | + |
1 | 5 | # Intro |
2 | 6 |
|
3 | 7 | In this release, we are making a significant shift from a device-centered model to a user-centered model. A user-centered model allows for more powerful omni-channel integrations within the OneSignal platform. |
@@ -36,9 +40,26 @@ As mentioned above, the iOS SDK is making the jump from `v3` to `v5`, in order t |
36 | 40 |
|
37 | 41 | ## SDK Installation |
38 | 42 |
|
39 | | -Update the OneSignal SDK in your Xcode project |
| 43 | +### Import Changes |
| 44 | +**Objective-C** |
| 45 | + |
| 46 | +```objc |
| 47 | + // Replace the old import statement |
| 48 | + #import <OneSignal/OneSignal.h> |
| 49 | + |
| 50 | + // With the new import statement |
| 51 | + #import <OneSignalFramework/OneSignalFramework.h> |
| 52 | +``` |
| 53 | +**Swift** |
| 54 | +```swift |
| 55 | + // Replace the old import statement |
| 56 | + import OneSignal |
| 57 | + |
| 58 | + // With the new import statement |
| 59 | + import OneSignalFramework |
| 60 | +``` |
40 | 61 |
|
41 | | -TODO: What changes, if any, for importing OneSignal into a project via CocoaPods, SwiftPM |
| 62 | +Update the version of the OneSignal iOS SDK 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). |
42 | 63 |
|
43 | 64 | # API Changes |
44 | 65 | ## Namespaces |
@@ -197,8 +218,8 @@ The SDK is still accessible via a `OneSignal` static class. It provides access t |
197 | 218 | | `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.* | |
198 | 219 | | `let granted: Bool = OneSignal.privacyConsent`<br><br>`OneSignal.privacyConsent = true` | `BOOL granted = OneSignal.getPrivacyConsent`<br><br>`[OneSignal 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].* | |
199 | 220 | | `let required: Bool = OneSignal.requiresPrivacyConsent`<br><br>`OneSignal.requiresPrivacyConsent = true` | `BOOL required = [OneSignal requiresPrivacyConsent]`<br><br>`[OneSignal 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.* | |
200 | | -| `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.* | |
201 | | -| `OneSignal.setProvidesNotificationSettingsView(true)` | `[OneSignal setProvidesNotificationSettingsView:true]` | TODO: Not new but I can’t find this in our documentation at all. | |
| 221 | +| `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.* |
| 222 | +| |
202 | 223 |
|
203 | 224 |
|
204 | 225 |
|
|
0 commit comments