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 · 5 comments
Open

feat: maintain path after update has installed #193

alexcroox opened this issue Apr 23, 2023 · 5 comments

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?)

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

No branches or pull requests

2 participants