React-Native GoogleSignin.SIGN_IN_CANCELLED

mic*_*996 2 firebase react-native firebase-authentication google-signin expo

我使用react-native firebase从这个包中使用Google登录:

https://github.com/react-native-google-signin/google-signin#project-setup-and-initialization
Run Code Online (Sandbox Code Playgroud)

使用:yarn add @react-native-google-signin/google-signin

它在 Android 上完美运行,让我按需要登录,但它在 iOS 上根本不起作用,并且遇到了以下错误

ERROR TypeError: null is not an object (evaluating 'RNGoogleSignin.SIGN_IN_CANCELLED')
Run Code Online (Sandbox Code Playgroud)

我不明白为什么这种情况发生在 iOS 上而不是 Android 上:

过程:

1. yarn add @react-native-google-signin/google-signin
2. cd ios
3. pod install

- I have updated the GoogleService-Info.plist
- I have the enabled "sign in with Apple"
- The URL types have been update with reverse ID
Run Code Online (Sandbox Code Playgroud)

欢迎任何帮助!

mic*_*996 7

只是通过更改包裹编号来解决这个问题

"@react-native-google-signin/google-signin": "^8.0.0",
Run Code Online (Sandbox Code Playgroud)

对此:

"@react-native-google-signin/google-signin": "7.2.2",
Run Code Online (Sandbox Code Playgroud)

希望这可以帮助任何有需要的人!