Sign In With Apple and Older Devices

Hello,

I am working on implementing Sign In With Apple. I am wondering how we handle devices that are not iOS 13+ and thus do not support it. Should we detect this and hide the option to SIWA? If so, what's the best way? I am using the official Unity SIWA plugin and I don't see any methods in there to detect if SIWA is supported on the current device.

Thanks!

Replies

I found a thread in Unity forums for this topic.

forum.unity.com/threads/sign-in-with-apple.876394/

all you need to do is use a #if available
Code Block swift
if #available(iOS 13, *) {
// show Sign In with Apple button
} else {
// hide Sign In with Apple button
}


I see. I ended up doing it this way:

Code Block C#
Version currentVersion = new Version(System.iOS.Device.systemVersion);
Version ios13 = new Version("13.0");
 
if (currentVersion >= ios13)
{
   // Enable the button...
}


Would your way continue to work with iOS 14?

if #available(iOS 13, *)



You can create a stackView and link with your ViewController and create appleSignIn button programmatically
Then you can check iOS version and add it to your stackView
Code Block  
        if #available(iOS 13.0, *) {
/* iOS13 available add button! */
self.stackView.addArrangedSubview(appleSignInButton)
} else {
/* continue */
}

This is the best approach to handle the button with lower version of iOS!