Raj*_*our 6 android react-native firebase-authentication expo
我在 React Native google 登录模块中遇到异常错误。这是错误中的完整代码片段
TypeError: null is not an object (evaluating 'RNGoogleSignin.SIGN_IN_CANCELLED')
export const statusCodes = {
SIGN_IN_CANCELLED: RNGoogleSignin.SIGN_IN_CANCELLED,
IN_PROGRESS: RNGoogleSignin.IN_PROGRESS,
PLAY_SERVICES_NOT_AVAILABLE: RNGoogleSignin.PLAY_SERVICES_NOT_AVAILABLE,
SIGN_IN_REQUIRED: RNGoogleSignin.SIGN_IN_REQUIRED,
};
Run Code Online (Sandbox Code Playgroud)
在node_modules@react-native-google-signin\google-signin\src\GoogleSignin.ts
我无法找到解决方案。
这是我的代码片段
import React, { useState } from "react";
import { View, Text, StyleSheet, StatusBar } from "react-native";
import SplashBG from "../icons/splashbg";
import Logo from "../icons/logo";
import { GoogleSignin } from '@react-native-google-signin/google-signin';
const GetLoginStatus = async () => {
GoogleSignin.configure({ webClientId: '265662725956-ukku7c59o0afjqpig79bdcsrdnai4063.apps.googleusercontent.com' });
await GoogleSignin.hasPlayServices();
const userInfo = await GoogleSignin.signIn();
console.log(userInfo);
}
const Splash = () => {
const userstatus = GetLoginStatus();
return (
<>
<View style={styles.BGContainer}>
<Text>Login Screen</Text>
</View>
</>
);
}
export default Splash;
Run Code Online (Sandbox Code Playgroud)
我的React Native版本react-native@0.63.2 @react-native-google-signin/google-signin@7.0.0-alpha.3
我在 Android 中遇到此错误。我还没有在 iPhone 上检查过,但现在可能也出现同样的错误。
请帮忙。
| 归档时间: |
|
| 查看次数: |
4389 次 |
| 最近记录: |