pichillilorenzo / flutter_inappwebview

A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.
https://inappwebview.dev
Apache License 2.0
3.15k stars 1.47k forks source link

android WebView [cacheEnabled: false is not working.] #2034

Open minh-dai opened 6 months ago

minh-dai commented 6 months ago

Environment

Technology Version
Flutter version >= 3.13.0
Plugin version 6.0.0
Android version 12
iOS version any
macOS version Sonoma 14.1
Xcode version 15.0.1
Google Chrome version

Current behavior: i tried clear all cache but it it not working with the last version, but i use version 5.8 it work

Expected behavior: the webview doesn't cache anything.

Screenshot 2024-02-21 at 16 37 31
github-actions[bot] commented 6 months ago

👋 @minh-dai

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 android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

haticeay commented 6 months ago

@minh-dai I have the same problem. Every time I click, the previous clicked data comes up. Did you find a solution? If you found it, could you share it with me?

minh-dai commented 6 months ago

@haticeay Hello, please try this code before you open webview. if (Platform.isAndroid) { InAppWebViewController.clearAllCache(); final cookieManager = CookieManager.instance(); cookieManager.removeSessionCookies(); }

haticeay commented 6 months ago

@minh-dai thankyou i will try

toshiossada commented 4 months ago

@minh-dai this work for android, but for ios what I can do?

paulVulog commented 3 months ago

Hi there, I have actually the exact same issue with version 6.0.0 : I have always the same WebView display when I change the url parameters.

I can reproduce my issue on version 5.8.0 when I set the clearCache webViewSettings to False.

Since this parameter is now deprecated on 6.0.0 and replaced by InAppWebViewController.clearAllCache(), I have done some test with it. No way to have it working - even by doing the @minh-dai tips. (I tried to ClearCache and RemoveCookies everywhere, but no luck, it still display my previous webView)

Any clue / fix on this ? From my point of view, the clearCache feature is now broken on 6.0.0 and no way to fix it (android and iOS by the way... ) .

paulVulog commented 1 month ago

Hi, Any Update / Clue on this ?

paulVulog commented 5 days ago

Hi @minh-dai Any update on your side ?

minh-dai commented 4 days ago

@paulVulog Sorry, i just use this code and it's working for me. if (Platform.isAndroid) { InAppWebViewController.clearAllCache(); final cookieManager = CookieManager.instance(); cookieManager.removeSessionCookies(); }