SDK Version: 48.0.18
Platforms: IOS
I’m trying to setup Apple Oauth using expo-apple-authentication but the sign in attempt is responding with “The authorization attempt failed for an unknown reason.” can anyone see a mistake in my code that might be causing this issue?
The error message is so unspecific that im really not sure what to do next, so any help would be a lifesaver
const [appleAuthAvailable, setAppleAuthAvailable] = useState(false);
useEffect(() => {
const checkApple = async () => {
const isApple = await AppleAuthentication.isAvailableAsync();
setAppleAuthAvailable(isApple);
};
checkApple();
}, );
const getAppleAuth = () => {
return (
<AppleAuthentication.AppleAuthenticationButton
buttonType={AppleAuthentication.AppleAuthenticationButtonType.SIGN_IN}
buttonStyle={AppleAuthentication.AppleAuthenticationButtonStyle.BLACK}
cornerRadius={5}
style={styles.appleButton}
onPress={appleLogin}
disabled={isSignedIn}
/>
);
};
const appleLogin = async () => {
setIsSignedIn(true);
try {
const creds = await AppleAuthentication.signInAsync({
requestedScopes: [
AppleAuthentication.AppleAuthenticationScope.FULL_NAME,
AppleAuthentication.AppleAuthenticationScope.EMAIL,
],
});
alert(creds)
} catch (e) {
alert(e);
}
{appleAuthAvailable ? getAppleAuth() : null}