Android-PWA-Wrapper
Android-PWA-Wrapper copied to clipboard
External links constantly opening
I am having one slight issue at the moment.
When external links are pressed in the app/twa, they open an instance of chrome/firefox/other_browsers, and constantly load up new tabs of the external site address. I am greeted with 200+ tabs for the same address each time.
I have little to no android development experience, the only thing I can seem to debug is that the lines;
view.stopLoading();
view.reload();
in Android-PWA-Wrapper/app/src/main/java/at/xtools/pwawrapper/webview/WebViewHelper.java seem to be the issue.
Removing the view.reload means the external site is only opened in one tab in the default browser, however pressing back button to go back into the app means that the pwa is now frozen. Unfortunately I do not have enough knowledge on what the best solution is
Hi! The workaround i found to solve this is: IIn Android-PWA-Wrapper/app/src/main/java/at/xtools/pwawrapper/webview/WebViewHelper.java
REMOVE the lines
view.stopLoading(); view.reload();
INSTEAD ADD:
view.loadUrl(Constants.WEBAPP_URL);
after the try{}catch{} of the intent for the external link
The thing is that this is not a complete solution as it navigates to the specified url in every external link.
What is happening in this issue is that the app is entering in an infinite loop with the reload inside the @Override of onPageStarted().
hope it helps..
Thanks, but is there a better solution to this problem?
Problems:
- this reloads the PWA app
- my primary browser is Firefox and while this solution sends a new tab to Firefox in background, it does not switch to the browser view
Hey, I'm trying to solve the same issue. Did you guys find a better solution eventually?
+1
I have created a pull request with a fix for this. I hope these changes can solve the issue.
will somebody merge it? @xtools-at
Thx @camoralb, will test/merge it when I'm back from vacation
please could you merge it?
not yet merged?