Expo.Google.LogInAsync not returning result

#1

Hello , the official expo documentation of google sign in . My code is not executing if(result.type == ‘success’ ) for recheck i just added a console.log message to it which was not displayed but in expo-cli the google pop up shows up that means its a successful sign in…

async loginWithGoogle() {
this.setState({loading: ‘google’})
try {
const result = await Expo.Google.logInAsync({
androidClientId: credentials.androidClientId,
iosClientId: credentials.iosClientId,
scopes: [‘profile’, ‘email’]
})

  if (result.type === 'success') {
    await loginWithGoogle({accessToken: result.accessToken}, this.props.client)
  }
} catch (error) {
  const errorMessage = error.message.replace('GraphQL error: ', '')
  Alert.alert('Login error', errorMessage)
}
this.setState({loading: null})

}

3 Likes
#2

Same problem :slightly_frowning_face:

closed #3

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.