swiftwkwebviewazure-ad-b2cwkwebviewconfiguration

WKWebView buttons dont work after Apple Login session


I'm stuck with a problem. First of all, I'm using MSAL and Azure B2C for the sign up. One of the Identity Providers is Apple Login. Now when I press the Apple Login button, the usual Face-Id screen opens. Great. Now say I changed my mind, and I don't want to login with Apple, so I press cancel.

So now I'm back again and I want to use another Provider. But now when I press a button (doesn't matter which one) they don't work. They are being selected/highlighted though, but there is no actual action taking place.

Oh, and at the point I pressed cancel at the Apple login, this error log pops up in the logs:

didFailProvisionalLoadForFrame: frameID = 3, domain = WebKitErrorDomain, code = 102

Does anybody have an idea why my buttons don't work anymore? I suppose it's a setting I'm missing in WKWebView. Because when I use the SafariController, it does work.


Solution

  • Found the solution:

    I changed the user agent of the webView. This worked:

    myWebView.customUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1"