Skip to content

Instantly share code, notes, and snippets.

@asumansenol
Last active April 3, 2020 15:47
Show Gist options
  • Save asumansenol/4603a6d62795136a06ee2be728cbd181 to your computer and use it in GitHub Desktop.
Save asumansenol/4603a6d62795136a06ee2be728cbd181 to your computer and use it in GitHub Desktop.
signInWithGoogleAsync = async () => {
try {
const result = await Google.logInAsync({
androidClientId: ANDRIOID_CLIENT_ID,
iosClientId: IOS_CLIENT_ID,
behavior: 'web',
iosClientId: '', //enter ios client id
scopes: ['profile', 'email']
});
if (result.type === 'success') {
this.onSignIn(result);
return result.accessToken;
} else {
return { cancelled: true };
}
} catch (e) {
return { error: true };
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment