Posts

Post not yet marked as solved
5 Replies
After a week struggling, I found a way to make it work. Posting here in case anyone need. #1 Have an instance of processPool and wesiteDataStore.nonpersistent() (make them a global variables if you want to get the Cookies outside of webview didFinish navigation of the same wkWebview) #2 Create an instance of wkWebviewconfigure with these two: var wkWebviewconfigure: WKWebViewConfiguration = WKWebViewConfiguration() wkWebviewconfigure.processPool = myProcessPool wkWebviewconfigure.websiteDatastore = myWebsiteDatastore // <--- have to be nonpersistent type #3 Generate webview from code with this wkWebviewconfigure, assigning wkWebviewconfigure to your wkWebview.configuration from .xib and storyboard will not work
Post not yet marked as solved
5 Replies
I already implement with singleton WKProcessPool and pass here when initialize this WKWebviewViewController. Here is a sample logic I used to check the cookies from an website url after it finishes the navigation, cookies does not there import UIKit import WebKit class WKWebviewViewController: UIViewController, WKUIDelegate, WKNavigationDelegate {   var urlToLoad: String = "&lt;any website url, I even try with apple.com&gt;"   var cookiesTxt: String! var processPool: WKProcessPool!   var wkWebviewconfigure: WKWebViewConfiguration = WKWebViewConfiguration()   var webView: WKWebView!   override func viewDidLoad() {     super.viewDidLoad()     // webView programatically     let bounds = self.view.bounds     let frame = CGRect(x: bounds.origin.x, y: bounds.origin.y + 100, width: bounds.width, height: bounds.height)    wkWebviewconfigure.processPool = processPool     self.webView = WKWebView(frame: frame, configuration: wkWebviewconfigure)     self.view.addSubview(self.webView)     webView.navigationDelegate = self     webView.uiDelegate = self     if let url = URL(string: urlToLoad) {       let request = URLRequest(url: url)       DispatchQueue.main.async {         self.webView.load(request)       }     }   }    public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {     let httpCookieStore = webView.configuration.websiteDataStore.httpCookieStore     httpCookieStore.getAllCookies { (cookies) in       print(cookies) // <--- not getting all the cookies most of time here, but sometime it works     }   } }
Post not yet marked as solved
5 Replies
I have same issue, do we have any updates/work around for this issue ?
Post not yet marked as solved
10 Replies
Yes, I try adding the sendMessage at the same place, and it works, that strange, same code run in Xcode 10 works in both cases. if wcSession.isReachable { let data = ["text": "User info from the iphone"] wcSession.transferUserInfo(data) // --&gt; WatchKit does not receive this let message = ["TestID": "send Message from the iphone"] wcSession.sendMessage(message, replyHandler: nil) // --&gt; WatchKit receive this }Look like I need to migrate to use sendMessage instead since we cannot deploy with Xcode 10 from April 2020
Post not yet marked as solved
10 Replies
Thanks for your response Claude31,Did you use the method transferUserInfo from iOS to AppWatch ?I did run both targets for watch app and then for iOS App. And from iOS app (ViewController) and I can still send message to WatchApp (InterfaceController) with this wcSession.updateApplicationContext(message), but the other method wcSession.transferUserInfo(data) does not worked. This is just a testing prototype, in my main app we use heavily data on transferUserInfo so I need to figure out the issue with breaking transferUserInfo
Post not yet marked as solved
13 Replies
Hi Eskimo,My company implements the biometric support and we want to give users a short-cut to set up their touch/face id if they haven't done that. The only way I found is using "App-Prefs:root=TOUCHID_PASSCODE". Will our app be rejected if we use this URL?Hope to get your response soon!Thank and Best Regards,Huy VuP.S. looks like the URL only deep link to device root settings, cannot go to a specific setting. But still, is it allowed to use "App-Prefs" ? since "UIApplicationOpenSettingsURLString" will deep link to app settings (which does not have Touch/Face set up)