Repository navigation
feat(onboarding): resume onboarding after a kill and on re-login - #1151
Merged
Merged
Conversation
A kill on the name or push screen relaunched straight to home, because registration sets the current account before onboarding finishes. A reinstall and re-login skipped the push prompt for the same reason. Track a per-owner onboarding-completed marker in UserDefaults (absent means completed, so upgraded users stay on home). Registration and interactive logins write false before the account becomes current; the end of onboarding writes true. A launch with a false marker holds the account and resumes at the display-name step when the profile has no name, otherwise at the push step. Seed entry, the account picker and switchAccount go through the same gate.
The keychain keeps the signed-in account across an uninstall but UserDefaults does not, so a reinstall found no onboarding marker and went straight home with notification permission reset. A first launch that already has a current account now reopens the marker.
While an account waits on its resumed step the intro is replaced by the launch background, and the stack is created with the path already seeded so the first screen has no push animation. The resumed first screen hides its back button, and the push step can return to the name step only when the name step is in the flow. The profile lookup gives up after 5 seconds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Killing the app on the display-name or push screen relaunched straight to home, because registration makes the account current before onboarding finishes. The same hole meant a reinstall or a re-login never offered the push prompt. Android already handles both; this matches its behavior.
onboardingCompletedmap in UserDefaults (OnboardingProgress). An absent entry counts as completed, so users upgrading from a build without it stay on home.falseis written inauthenticatebeforeaccountManager.setfor registrations and interactive logins;trueis written right beforecompleteLoginat the end of onboarding.falsemarker is held inSessionAuthenticator.pendingOnboardinginstead of callingcompleteLogin.IntroScreenhands it toOnboardingViewModel.resumeOnboarding, which shows the display-name step if the profile has no name (fetched with the account's own key; falls back to the cached name, and skips the step if neither is known) and then applies the existingadvanceFromNameSteppush rule.switchAccount(including theflipcash://logindeep link) callbeginOnboardinginstead ofcompleteLogin, so they run the same name/push gate.launchCount == nil) that already has a current account reopens the marker and offers push again.No new UI; the existing name and push screens are reused. Unlike Android there is no resume-at-access-key point, since iOS registers after the key is confirmed.