我有一个Reactnatve应用程序,它有一个注册whith谷歌按钮,当我点击登录,我得到的数据在consoleiderlog我想保存在firebase的数据,我不知道如何做
const googleLogin = async () => {
try {
await GoogleSignin.hasPlayServices();
const userInfo = await GoogleSignin.signIn();
console.log(userInfo);// i am getting user data here
} catch (error) {
if (error.code === statusCodes.SIGN_IN_CANCELLED) {
// user cancelled the login flow
} else if (error.code === statusCodes.IN_PROGRESS) {
// operation (e.g. sign in) is in progress already
} else if (error.code === statusCodes.PLAY_SERVICES_NOT_AVAILABLE) {
// play services not available or outdated
} else {
// some other error happened
}
}
};
1条答案
按热度按时间dfty9e191#
你可以参考这个链接的谷歌社会认证,这是你正在寻找保存认证数据到firebase: