Реагировать на родной Google Signin просит разрешения Google Drive - PullRequest
1 голос
/ 10 января 2020

Я создал приложение со входом в Google, но Google запрашивает разрешения на диске Google. Как я могу удалить разрешения Google Drive в приложении? я не хочу показывать всплывающее окно с запросом разрешений на диске Google.

firebaseGoogleLogin = async () => {
    try {
      // add any configuration settings here:
      await GoogleSignin.hasPlayServices();
      const userInfo = await GoogleSignin.signIn();
      this.setState({ userInfo: userInfo, loggedIn: true });
      // create a new firebase credential with the token
      const credential = firebase.auth.GoogleAuthProvider.credential(userInfo.idToken, userInfo.accessToken)
      // login with credential
      const firebaseUserCredential = await firebase.auth().signInWithCredential(credential);
    } catch (error) {
      console.log(error)
      if (error.code === statusCodes.SIGN_IN_CANCELLED) {
        // user cancelled the login flow
      } else if (error.code === statusCodes.IN_PROGRESS) {
        // operation (f.e. 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 Ответ

2 голосов
/ 19 апреля 2020

У меня была та же проблема, и я понял, что вы должны удалить свойство scope из метода google configure.

GoogleSignin.configure({
            scopes: ['https://www.googleapis.com/auth/drive.readonly'], // what API you want to access on behalf of the user, default is email and profile
            webClientId: '--------------- your web client id ---------',
        });
...