Created
December 21, 2019 11:49
-
-
Save davydany/a84fe85f8e326aa6ee77d896875c539f to your computer and use it in GitHub Desktop.
Check for iOS 13 for Apple Signin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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