Skip to content

Instantly share code, notes, and snippets.

@roshangm1
Created February 1, 2018 05:23
Show Gist options
  • Save roshangm1/c8cec6f9da04919d1abbc7ce5f9be911 to your computer and use it in GitHub Desktop.
Save roshangm1/c8cec6f9da04919d1abbc7ce5f9be911 to your computer and use it in GitHub Desktop.
Login Bug
loginWithFb = () => {
manager.deauthorize('facebook')
manager.authorize('facebook', {scopes: 'email'})
.then((resp) => {
console.log(resp);
const accessToken = (Platform.OS === 'ios') ? resp.response.credentials.accessToken : resp.credentials.accessToken
this.sendFbTokenToServer(accessToken, 'facebook')
});
}
loginWithGoogle = () => {
manager.deauthorize('google')
manager.authorize('google', {scopes: 'email'})
.then((resp) => {
console.log(resp)
const accessToken = (Platform.OS === 'ios') ? resp.response.credentials.accessToken : resp.credentials.accessToken
this.sendFbTokenToServer(accessToken, 'google')
})
.catch(err => {
console.error(err);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment