May I place the "Sign in with Apple" button in UIWebView?

My services is using UIWebView for login/register flow now.

I want to insert the "Sign in with Apple" button in the page but don't want to go for web platform flow (i.e. through Apple JS), because we want to use FaceID / TouchID for login.

Can I place the "Sign in with Apple" Button in the In-App webview, but trigger the native framework action for complete the "Sign in with Apple" flow.


Also, from the Apple Human Interface Guideline (https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple/overview/), there are only one "Sign in with Apple" button. However, our service have separated "Sign In" and "Sign Up" page. Can I have two button with wordings "Sign in with Apple" and "Sign up with Apple" in the page correspondingly? or any suggested solution for this case.


Thank you!

Hi cowboyEric,


AppleJS API is fully compatible with the FaceID/TouchID login when executed through WKWebView or Safari browser.

On WebKit based views / browsers, a native SIWA UI will be shown providing the same experience as a native API.


Essentially the system provides the experience you desire for free without any further integration required. If you do not see such behavior, a radar with a sysdiagnose, video and a sample project would be great. While UIWebView may work there are no gurantees about it working correctly, I would strongly encourage you to move to WKWebView if possible.

i Used AppleJS API with WKWebView. it workes with "sign in with a different Apple ID" only. When i used TouchID it passed login but not authenticated in my webView.

Hi, dima_beliy

I found Apple device that does not work with webview+SIWA.

I have tested only two devices so far, iPhone12/iOS16.6 and iPadPro(12.9inch,5Gen)/iPadOS17.1.2.

For iPhone it works as expected. If I open URL "https://appleid.apple.com/auth/authorize?..." via AWS Cognito, webview will show native SIWA UI.

However, in case of iPadPro, if I open the URL via AWS Cognito, webview will not show native SIWA UI and webview will just show apple-id login webpage. Webview will not redirect or anything, and If I enter email/password in that login webpage it can successfully proceed authentication. Native SIWA UI is not shown but it works as a simple login interface.

I used https://github.com/gree/unity-webview/ for webview with following option:

webView.Init(
enableWKWebView: true,
separated: false,
started: async (msg) =>
{
// ...
}
);

Complete setup is AWS Cognito + SignInWithApple + unity-webview + iPadPro(12.9inch,5Gen)/iPadOS17.1.2.

May I place the "Sign in with Apple" button in UIWebView?
 
 
Q