wkhttpcookiestore

From IOS 13.0 cookiesDidChange is never triggered when cookies change on webview

会有一股神秘感。 提交于 2020-06-15 05:47:06
问题 I am using Cookie Store Observer to to track changes in the cookies value on my webview. It was working fine on all versions of IOS. but since IOS 13.0 came out, this no longer works. I am not getting any call to @available(iOS 11.0, *) func cookiesDidChange(in cookieStore: WKHTTPCookieStore){ cookieStore.getAllCookies { cookies in //Store cookies to UserDefaults on Background Thread DispatchQueue.global(qos: .userInitiated).async { self.storeCookies(cookies: cookies) } } } I am setting

WKWebview getAllCookies crash in iOS 11.3

泪湿孤枕 提交于 2019-12-05 22:05:04
问题 We have recently migrated to WKWebview. We have added a listener for cookie change, to get the updated cookies and update our own store. - (void)cookiesDidChangeInCookieStore:(WKHTTPCookieStore *)cookieStore { [cookieStore getAllCookies:^(NSArray* cookies) { }]; } Once the controller is loaded, it calls cookiesDidChangeInCookieStore and crashes at "getAllCookies".But this crash happens only in TestFlight/Fabric build. Doesn't happen when i run the app directly on device from xcode (both in

WKWebview getAllCookies crash in iOS 11.3

回眸只為那壹抹淺笑 提交于 2019-12-04 03:36:29
We have recently migrated to WKWebview. We have added a listener for cookie change, to get the updated cookies and update our own store. - (void)cookiesDidChangeInCookieStore:(WKHTTPCookieStore *)cookieStore { [cookieStore getAllCookies:^(NSArray* cookies) { }]; } Once the controller is loaded, it calls cookiesDidChangeInCookieStore and crashes at "getAllCookies".But this crash happens only in TestFlight/Fabric build. Doesn't happen when i run the app directly on device from xcode (both in debug and release mode). Below is the crash report, Thread 9 name: WebThread Thread 9 Crashed: 0 WebKit

WKWebView setting Cookie not possible (iOS 11+)

心已入冬 提交于 2019-12-03 22:22:59
问题 I am desperately trying to add a custom cookie to a WKWebView instance (without using Javascript or similar workarounds). From iOS 11 and upwards, Apple provides an API to do this: The WKWebView s WKWebsiteDataStore has a property httpCookieStore . Here is my (example) code: import UIKit import WebKit class ViewController: UIViewController { var webView: WKWebView! override func viewDidLoad() { webView = WKWebView() view.addSubview(webView) super.viewDidLoad() } override func viewWillAppear(_

WKWebView setting Cookie not possible (iOS 11+)

纵然是瞬间 提交于 2019-12-01 12:24:58
I am desperately trying to add a custom cookie to a WKWebView instance (without using Javascript or similar workarounds). From iOS 11 and upwards, Apple provides an API to do this: The WKWebView s WKWebsiteDataStore has a property httpCookieStore . Here is my (example) code: import UIKit import WebKit class ViewController: UIViewController { var webView: WKWebView! override func viewDidLoad() { webView = WKWebView() view.addSubview(webView) super.viewDidLoad() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) let cookie = HTTPCookie(properties: [