0

I am using WKWebView in swift4 Xcode 10. I am loading a site and user is supposed to logged in which will take him to next page which is a dashboard.

The url is perfectly working in Safari. User can easily logged in but when I load the url in WKWebView and hit Login Button it stucks there and nothing happens. So far I have no idea what's going wrong as the same site is working fine in Safari App so I expect it to work in WKWebView as well

 let webConfiguration = WKWebViewConfiguration()
    webView = WKWebView(frame: .zero, configuration: webConfiguration)
    webView.uiDelegate = self
    view = webView
    let url = URL.init(string: ".com/app/#/login")
    let request = URLRequest.init(url: url!)
    webView.load(request)
Muhammad Nayab
  • 1,344
  • 12
  • 13
  • After login there should be some cookies changed on the base user can see this is logged in user or non logged in user. Wkwebview has it own cookie.. kindly check with your server guy which cookies required for login. – Shauket Sheikh Nov 03 '18 at 12:22
  • the thing is its working in Safari as well as on Android its quite simple – Muhammad Nayab Nov 03 '18 at 17:36
  • I think you missed my comment please read again. I said wkwebview has their own cookie storage, may be your cookies are not syncing thats why its not working. For debug use safari developer debug tool – Shauket Sheikh Nov 03 '18 at 23:27

0 Answers0