我正在开发一个react-native应用程序,我想让我的用户能够使用google登录.但是,当我向google API发出请求时,它会返回WRONG SIGNIN Error: DEVELOPER_ERROR.
我正在使用AWS Cognito,并希望将Google登录与其集成.我看到一些问题说要生成我的"webClientId"的SHA-1蓝图,但所有这些都使用了firebase.在Cognito上,没有字段可以添加相应的SHA-1蓝图.
我的代码如下:
componentWillMount() {
GoogleSignin.configure({
webClientId: googleConfig.clientId
});
}
...
googleSignIn() {
GoogleSignin.signIn()
.then((user) => {
console.log(user);
this.setState({user: user});
})
.catch((err) => {
console.log('WRONG SIGNIN', err);
})
.done();
}
...
<GoogleSigninButton
style={{ height: 48 }}
size={GoogleSigninButton.Size.Standard}
color={GoogleSigninButton.Color.Light}
onPress={this.googleSignIn.bind(this)}/>
Run Code Online (Sandbox Code Playgroud)
在此先感谢您的帮助.