Skip to content

Commit 8aefc95

Browse files
authored
docs: add installation migration info (#427)
1 parent 6956072 commit 8aefc95

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

MIGRATION.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This document describes how to migrate from the [Parse ObjC SDK](https://github.
88
- [Migration Instructions](#migration-instructions)
99
- [Behavioral Differences](#behavioral-differences)
1010
- [Known Issues](#known-issues)
11+
- [Installation](#installation)
1112
- [Feature Comparison](#feature-comparison)
1213

1314
# Status of the SDKs
@@ -116,9 +117,26 @@ The Parse ObjC SDK will be phased out in the future in favor of the more modern
116117

117118
# Known Issues
118119

119-
These issues below are especially important to consider before migrating.
120+
The following issues are important to consider before migrating.
120121

121-
- After migrating an app to the Parse Swift SDK, launching the app will create a new `Installation` object with a new `installationId`. It will appear as if the app had been uninstalled and then reinstalled, even though it was only updated with the new Parse Swift SDK.
122+
## Installation
123+
124+
After migrating an app to the Parse Swift SDK, launching the app will create a new `_Installation` object with a new `installationId`. It will appear as if the app had been uninstalled and then reinstalled, even though it was only updated with the new Parse Swift SDK.
125+
126+
This may be problematic if the installation object is directly referenced in your app or if it contains fields that should be maintained, like the `badge` number field for example. To address this, here are two options:
127+
128+
- a) Use the Parse Swift SDK *together with* the Parse ObjC SDK in your project. This way you can migrate the installation by referencing the installation's `objectId`:
129+
130+
```swift
131+
import Parse // Parse ObjC SDK
132+
import ParseSwift // Parse Swift SDK
133+
134+
let objcInstallation = PFInstallation.current()!
135+
let swiftInstallation = try await Installation.become(objcInstallation.objectId!)
136+
```
137+
- b) Release an update for your app which stores the installation's `objectId` somewhere. Once the app has seen a sufficient adoption, you could release an app update with only the Parse Swift SDK and use the stored `objectId` to migrate to the installation.
138+
139+
Both options may require a long-term migration if your existing app has many installations and until the adoption rate with either approach is high enough.
122140

123141
# Feature Comparison
124142

0 commit comments

Comments
 (0)