-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
When app is in background, and then other appsareused, switching back to our app fails to display the webview #1923
Comments
NOTE: This comment is auto-generated. Are you sure you have already searched for the same problem? Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem! If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue. In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding Following these steps can save you, me, and other people a lot of time, thanks! |
Use latest plugin version 6. |
Ok thank you @pichillilorenzo , i'll make the same tests with |
Thanks again @pichillilorenzo , I tried with the little code I've shown and it fixed my issue, i'll try in my main app. Thank you for that quick answer ! |
Ok, version 6 has a lot of changes under the hood 👍 |
Hi @pichillilorenzo , Thanks for sharing a possible working solution so quickly, and I am working to migrate to the ^6.0.0-rc.2 to see if it fixes my app, but I need to share critical information about this issue.
So, the bottom line is that our application is this component rendering our web app + native bindings using js bridge to run native code and integration with external devices, and etc. So, if this component does not work, then the application is useless, and our client operators are unable to use any other workaround. Upgrading to the v6 can potentially fix this issue, but I just started to struggle with the migration while I'm writing this. So, to be able to release an urgent fix I will need to put a high-risk update in place on a critical part of the application, and some complex integration that needs to keep working. If v6 works, I will probably not have the time for a v5 fix that would be ideal as it would allow me to release a small and low-risk fix. But, I hope that this message can make you change your mind about fixing the v5, so other users of this component will not have to release a critical fix doing a risky update, as more and more Android devices are upgrading. |
@jenseralmeida I understand the situation but the problem here is that I don’t know what is the cause about that and why it seems to work on v6 and not in v5. If you are able to reproduce the issue consistently, then you could take a little time to update the code to work for v6 and make the same tests to check if it works. Migrating to v6 should not be difficult: https://inappwebview.dev/docs/migration-guide Everything is there, just the older methods/settings has been set as deprecated. |
@pichillilorenzo , thank you again for taking the time to answer my message, and I got your point. I have no idea how you manage to maintain such a great product. I have finished my migration to v6 we are launching the beta version to the affected users while we take time for the proper testing. I ran into the issues below, and I am posting here to help others with the migration.
The migration is easy and quick, but as it is a bigger change between v5 and v6, and because of it we are just being over-cautious on the testing side. |
@jenseralmeida yes, that’s correct, I need to add that there. It was a change made recently because of the plugin conversion in a Federeted plugin and I forgot to add it there, thanks! v6 should be better in about a lot of things compared to v5. |
Migration guide updated with these tips 👍 |
I had the same issue on a Samsung A52s with Android 14, but not on a Samsung A14 with either Android 13 or Android 14. I have inappwebview 5.8.0. InAppWebView(
initialOptions: InAppWebViewGroupOptions(
android: AndroidInAppWebViewOptions(
useHybridComposition: true
)
),
//other arguments
) |
@synapticweb the issue is explained here: #1981 |
I also have the same issue, and can confirm that it can be fixed by setting |
It works. Adding hydridComposition for Android options sorted the issue. The webview now persists even when I navigate to other apps and my app is running in the background. Thanks for sharing this workaround @synapticweb |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue. |
Environment
Device information: Google Pixel 5
Description
Expected behavior: When the app goes in background to use other apps, when going back to foreground, it should display the webview as it was
Current behavior: If I put app background and foreground without other extra action, it works well. If i open others apps and switch back to that app (that is then resumed to foreground), the webview isn't visible anymore/disappeared. It's only a UI issue, because i see in the logs that it keeps getting actions from the user : i can click on buttons etc. I tried everything and the only way i found the to bring back the webview visible are :
Steps to reproduce
Simply using this code :
To be sure it's not a low-level webviexw issue I tried with
webview_flutter
, and that one doesn't have this "disappearing" issue.I don't see explciit errors in console, except maybe a "E/OpenGLRenderer(16792): Unable to match the desired swap behavior." that seems to occure when the app goes back to foreground (but it also appears when it successuflly goes back to foreground with webview shown...)
The text was updated successfully, but these errors were encountered: