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 cookie observer before the web-view is created.

WKWebsiteDataStore.default().httpCookieStore.add(self)

All of a sudden it stopped working from IOS 13.0. I havent noticed any change in docs around this API.

Anybody have any info on it on IOS 13.0?

来源:https://stackoverflow.com/questions/58397343/from-ios-13-0-cookiesdidchange-is-never-triggered-when-cookies-change-on-webview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!