Skip to content

Instantly share code, notes, and snippets.

@davydany
Created December 21, 2019 11:49
Show Gist options
  • Save davydany/a84fe85f8e326aa6ee77d896875c539f to your computer and use it in GitHub Desktop.
Save davydany/a84fe85f8e326aa6ee77d896875c539f to your computer and use it in GitHub Desktop.
Check for iOS 13 for Apple Signin
// IMPORTANT: I'll need to fix this when we go past iOS 13.
// Assume the following logic is inside a State<StatefulWidget>
supportsAppleSignIn = false;
@override
void initState() {
super.initState();
// initialize the AuthAgent
this.authAgent = AuthAgent();
// check if the device is iOS 13 or higher
if (Platform.isIOS) {
DeviceInfoPlugin().iosInfo.then((IosDeviceInfo iosDeviceInfo) {
String version = iosDeviceInfo.systemVersion;
print("iOS version is: $version");
if (version.startsWith('13')) {
setState(() {
this.supportsAppleSignIn = true;
});
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment