Hi all,
I'm facing with a very weird issue with a Xamarin Forms application on IoS after the latest OS update. Basically this application uses a WebView renderer to navigate a company's intranet portal which has NTLM authentication. I implemented the web renderer to handle the authentication process and it was working fine till few week ago but after Apple's last update the webview has stopped working.
Unfortunately there is no error code, exception or explicit message from the SDK, and the authentication process is working (I can see it from the logs), by the way the webview's content is all blank.
I have tried to navigate to other websites (with no authentication) too (bing.com, google.com, xamarin.com) but the issue was still there.
Anyone has some suggestion or hint?
Answers
UPDATE
After a deep investigation I've finally found the problem! Actually it seems that after the deprecation of UIWebview when using a custom renderer to handle authentication scenarios you cannot skip the HTTP 200 response (as suggested before) otherwise the component won't load the html contents!
So this is what I had before in my custom renderer:
and this is what I have changed:
Just commenting the if for StatusCode 200 and let contine with decisionHandler it works... Very very weird!
Thanks for sharing your successful experience.
Generally, the 200 StatusCode represents a successful call back from server and in that case we should use
decisionHandler(WKNavigationResponsePolicy.Allow);
to tell wkwebview to load this correct web request. If you do not want to show the following process in wkwebview, we can usedecisionHandler(WKNavigationResponsePolicy.Cancel);
to intercept it. Do not return when the code is 200, this would also block the process.