Using Sign in With Apple on OSX with wkwebview, -> appear native UI, then how can I handle cancel action?

Hello I trying to imeplement Sign in With apple on Desktop version(include macOS).

So, I request HTTP url that 'https://appleid.apple.com/auth/authorize?client_id=com.gcp2.crossplay.pe&nonce=xprodse8n2i&redirect_uri=https://www.google.com/testaaaa&response_mode=query&response_type=code'.

On macOS not showing apple id webpage, just show native UI like bellow.

My WKNavigationDelegate dosen't response when click after cancel button.

  • (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler;
  • (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation;
  • (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error;
  • (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error;
  • (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation;

is any way handle this situation?

Not sure if this will work, but may be worth a try:

Did you try setting the UIDelegate on the WKWebview and seeing if the WKWebview sends a -webViewDidClose: message to its UIDelegate?

Using Sign in With Apple on OSX with wkwebview, -> appear native UI, then how can I handle cancel action?
 
 
Q