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

1.5k Views Asked by At

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?

0

There are 0 best solutions below