使用 expo-apple-authentication 包不显示 Apple 身份验证按钮

cut*_*las 3 ios react-native expo apple-sign-in

我正在尝试使用expo-apple-authentication包在我的 iOS 应用程序中实现 Apple Sign In,但我无法显示该按钮。即使我使用与文档完全相同的代码:

 <AppleAuthentication.AppleAuthenticationButton
   buttonType={
     AppleAuthentication.AppleAuthenticationButtonType.SIGN_IN
   }
   buttonStyle={
     AppleAuthentication.AppleAuthenticationButtonStyle.BLACK
   }
   cornerRadius={5}
   onPress={() => {
   }}
 />
Run Code Online (Sandbox Code Playgroud)

值得注意的是,对 AppleAuthentication.isAvailableAsync() 的调用返回 true。

我正在模拟器中测试它。它不应该在开发环境中工作吗?那我该怎么测试呢?

Gen*_*gen 6

由于某些奇怪的原因,该按钮没有默认大小。应用你自己的风格可以解决这个问题。

<AppleAuthentication.AppleAuthenticationButton
  onPress={onSignIn}
  buttonType={AppleAuthentication.AppleAuthenticationButtonType.SIGN_IN}
  buttonStyle={AppleAuthentication.AppleAuthenticationButtonStyle.BLACK}
  style={{ width: 200, height: 64 }} // You must choose default size
/>
Run Code Online (Sandbox Code Playgroud)