Skip to content
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

feat: maintain path after update has installed #193

Open
alexcroox opened this issue Apr 23, 2023 · 7 comments · May be fixed by #506
Open

feat: maintain path after update has installed #193

alexcroox opened this issue Apr 23, 2023 · 7 comments · May be fixed by #506

Comments

@alexcroox
Copy link

alexcroox commented Apr 23, 2023

Feature Request

Description

With MS App Center's Codepush, once an update was installed, the current page/route would remain. This means when the user returns back to bring the app into focus, they won't realise anything happened.

Currently Capgo goes to the root (/) which for me is a login screen and I'd rather the user could continue where they left off.

Platform(s)

ios/android

Alternatives

If this isn't possible I could save current path before calling CapacitorUpdater.set(), then redirect to the path after install

@alexcroox alexcroox changed the title feat: Maintain path after update has installed feat: maintain path after update has installed Apr 23, 2023
@riderx
Copy link
Collaborator

riderx commented Jun 13, 2023

that a very good one, i have look but i don't know how to do it for now :)

@alexcroox
Copy link
Author

I wonder how Codepush does it? Do they maybe grab window.location.pathname before the install, and send the webview there after install?

@riderx
Copy link
Collaborator

riderx commented Jun 17, 2023

I don't know also yesterday looking into that i was wondering how to handle if you removed the path the user was in

@alexcroox
Copy link
Author

alexcroox commented Jun 17, 2023

Yeah it’s a good point. Definitely a config option you’d want to leave up to the developer so they can think to handle that in the future if they enable it

@alexcroox
Copy link
Author

alexcroox commented Aug 10, 2023

Adding note from our previous discussion on Discord. Perhaps we could allow the plugin to persist some state (a JS object) when setting the new version, which is then retrievable via new function or .current()?

e.g

CapacitorUpdater.set({ id: data.id, state: { exampleRedirectMeToPathAfterInstallKey: '/platform/dashboard' })

The challenge will be deciding where to retrieve this state, and how to delete it so old state isn't accessed in future updates if state isn't set next time (could it be versioned?)

@WcaleNieWolny
Copy link
Contributor

Hello, Martin has requested that I take a look at this issue to determine if it is easily implementable.

@WcaleNieWolny
Copy link
Contributor

I have just implemented this feature on Android.

2024-12-31.06-12-14.mp4

@WcaleNieWolny WcaleNieWolny linked a pull request Dec 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants