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

New option to keep event receiver when a new URL is loaded on webview #96

Open
r9pereira opened this issue Nov 5, 2019 · 2 comments
Open

Comments

@r9pereira
Copy link

Feature Request

New option to keep event receiver when a new URL is loaded on webview

Motivation Behind Feature

If you load a different URL on Cordova Webview, the onPause() and onDestroy() methods of NetworkManager are called in PluginManager.init() and the event receiver is removed . The event listener is not recovered with onResume() as the plugin has not the 'onload' flag set to true (if you force it on config.xml the notifications still do not work).
This behavior is problematic if your application loads several URLs during its life-cycle.

Feature Description

A new option to customize this behavior.

Alternatives or Workarounds

I found no workarounds without changing the plugi's source code.

@breautek
Copy link
Contributor

breautek commented Jun 9, 2020

This may not be an ideal workaround with a large existing app but a potential workaround is to adopt a SPA-style design in your application, which is recommended for a number of different reasons.

@r9pereira
Copy link
Author

Hi @breautek, thank you for the advise. Our app loads our website frontend and uses its responsive mode to fill the webview, but we also have secondary pages included in the app for scenarios like having no internet connection. The main page is SPA, but the transitions to the bundled pages were our issue.
We ended up creating a plugin of our own, as the changes we have done were a bit out of scope of this plugin.

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