feat: ability to open more than 1 webview and post messages to all or only specific one
Feature Request
Description
Right now if you open one webview on top of other it will overwrite the current one, resulting in not being able to communicate with more than 1 webview and when closing the last open webwiew the communication with the other webview wont be recovered.
I want to be able to open as many webviews as I want and being able to communicate with all of them in a broadcast like way or only with a specific one.
Platform(s)
iOS, Android
Preferred Solution
What I'm currently doing is assigning a random uuid to every new webview I open and returning that uuid with the openWebView method.
If I want to broadcast a message to all the webviews I will just use postMessage without any id, but if I want to communicate with a specific webview I would do:
await InAppBrowser.postMessage({
webViewId: uuid,
detail: { message: 'Hello WebView!' }
});
Hi, this is a discussion we had internally not long-ago. We don't currently plan to add a feature like this, but we will keep in mind that there is interest in this feature.
Would you be open for a PR with this feature (at least with the basics I need) that doesn't affect the current use of the plugin?
Sure, I would be open for that