-
-
Notifications
You must be signed in to change notification settings - Fork 70
feat: add migration from Obj-C SDK to Swift SDK #391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for opening this pull request!
|
Codecov Report
@@ Coverage Diff @@
## main #391 +/- ##
==========================================
- Coverage 89.17% 89.10% -0.07%
==========================================
Files 156 156
Lines 14553 14778 +225
==========================================
+ Hits 12977 13168 +191
- Misses 1576 1610 +34
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
What is the rationale behind this? Why isn't it updating the existing installation? Technically the app isn't newly installed, it's updated which wouldn't create a new installation in other Parse SDKs.
Could you explain? |
The server doesn’t let an app login with the same session token and same installation using “become” method. The installationId has to be different when leveraging the same sessionToken. The server is designed that way.
I’ve stated the SDKs are completely different, #391 (comment) in which they are, classes/structs, the way they encode/decode, etc. The Swift SDK knows how to speak to the server, not the Objective-C SDK or any other SDK. |
Why can't the Swift SDK migrate an existing ObjC SDK session token without using |
The Swift SDK can get the
I've answered this in the comment above. The developer will want to access
|
New Pull Request Checklist
Issue Description
Currently there's no way to migrate from the Objective-C SDK to the Swift SDK. This enforces developers who convert to have to ask users to log into applications again after migration. More discussion in here.
Related issue: #n/a
Approach
Use the session token (assuming it's still valid) from an already logged in user in the Objective-C SDK Keychain to become/login into the Swift SDK. This allows a seamless migration/login without interrupting the application flow and does not modify the original Objective-C Keychain or the original session token. There is no need to have the Parse Objective-C SDK as a framework in your project as the Swift SDK doesn't need it to access the keychain since the keychain belongs to the respective app and can be access via the
bundleId
. The methods introduced to allow this are:ParseUser
ParseInstallation
Note that logging in via the linked methods is the proper way to migrate to the Swift SDK as the SDK's themselves are entirely different and the Swift SDK should hydrate the
_User
and_Installation
ParseObject
's from the server instead of relying on the Objective-C SDK.Developers should also ensure the latest
PFUser
andPFInstallation
is saved to their Parse Server before migrating a user using these new methods. After initializing the SDK, migration should look something like:TODOs before merging