Merge branch 'Feature/Fix-persistance' of https://github.com/EA-YOUHOU/flutter_inappwebview into EA-YOUHOU-Feature/Fix-persistance

This commit is contained in:
Lorenzo Pichilli 2022-04-17 16:37:46 +02:00
commit bee61b35f2

View File

@ -532,7 +532,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
// See also https://forums.developer.apple.com/thread/97194
// check if websiteDataStore has not been initialized before
if(!options.incognito && options.cacheEnabled) {
configuration.websiteDataStore = WKWebsiteDataStore.nonPersistent()
configuration.websiteDataStore = WKWebsiteDataStore.default()
}
for cookie in HTTPCookieStorage.shared.cookies ?? [] {
configuration.websiteDataStore.httpCookieStore.setCookie(cookie, completionHandler: nil)