gmail integration in react native code example
Example 1: how to add oAuth google signin in react native app
import { GoogleSignin, GoogleSigninButton } from 'react-native-google-signin';
render() {
<GoogleSigninButton
style={{ width: 192, height: 48 }}
size={GoogleSigninButton.Size.Wide}
color={GoogleSigninButton.Color.Dark}
onPress={this._signIn}
disabled={this.state.isSigninInProgress} />
};
Example 2: google login with react native
signOut = async () => {
try {
await GoogleSignin.revokeAccess();
await GoogleSignin.signOut();
setloggedIn(false);
setuserInfo([]);
} catch (error) {
console.error(error);
}
};