flutter_inappwebview icon indicating copy to clipboard operation
flutter_inappwebview copied to clipboard

android WebView [cacheEnabled: false is not working.]

Open minh-dai opened this issue 1 year ago • 9 comments

  • [x] I have read the Getting Started section
  • [x] I have already searched for the same problem

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

minh-dai avatar Feb 21 '24 09:02 minh-dai

👋 @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!

github-actions[bot] avatar Feb 21 '24 09:02 github-actions[bot]

@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?

haticeay avatar Feb 22 '24 19:02 haticeay

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

minh-dai avatar Feb 23 '24 06:02 minh-dai

@minh-dai thankyou i will try

haticeay avatar Feb 23 '24 20:02 haticeay

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

toshiossada avatar May 14 '24 14:05 toshiossada

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 avatar Jun 12 '24 08:06 paulVulog

Hi, Any Update / Clue on this ?

paulVulog avatar Jul 29 '24 13:07 paulVulog

Hi @minh-dai Any update on your side ?

paulVulog avatar Sep 10 '24 13:09 paulVulog

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

minh-dai avatar Sep 11 '24 07:09 minh-dai