react-native-google-signin / google-signin

Google Sign-in for your React Native applications
https://react-native-google-signin.github.io/
MIT License
3.19k stars 878 forks source link

The screen greys out but the GoogleSignin modal doesn't show up. #1122

Closed seora closed 1 year ago

seora commented 1 year ago

I am working with google sign in react native with firebase. I just followed the docs, setup everything and it is working fine. The only problem i am facing is that it sometimes takes too much time (especially on app start) to show the modal with the google accounts. The screen greys out but the modal doesn't show up, just in Android.

It doesn't even show what error occurred. Even if I take a catch log, it doesn't work after await googleSigin.signin(). I would like to know whether it is an internal error, a firebase error, or a key error.

For this reason, development is taking a lot of time.

Steps to Reproduce

try {
            await checkCurrentUser();
            console.log("googlesignin");
            await GoogleSignin.hasPlayServices();
            console.log("googlesignin hasplayservices");
            const {idToken} = await GoogleSignin.signIn();
            console.log("googlesignin id token");
            await setLoginType("LOGINAPI", "GOOGLE");
            console.log("google token", idToken);
            const googleCredential = auth.GoogleAuthProvider.credential(idToken);
            const userCredential = await auth().signInWithCredential(googleCredential);
            console.log("userCredential ::", userCredential.additionalUserInfo);
            credentialVar(userCredential);
            setLoading(false);
        } catch(error) {
            console.log(error);
       }

Expected Behavior

Actual Behavior

스크린샷 2022-12-07 오후 5 54 42

Environment

Please provide

kwachta commented 1 year ago

I had the same issue. It turned out, I didn't have the "@react-native-google-signin/google-signin" added to the plugins in app.json.

skam22 commented 1 year ago

been running into the same issue - android screen goes grey but no modal.

ShoaibVirk008 commented 1 year ago

Facing same issue

Adeel984 commented 1 year ago

+1

alex-vasylchenko commented 1 year ago

+1

uboltabaev commented 1 year ago

+1

danielnathanael commented 1 year ago

Facing same issue here, but still not showing.

My only current solution is running react native in real device, the development must go on.

alex-vasylchenko commented 1 year ago

I fixed it by simply logging into my google account in the emulator (Settings -> Google)

BraveEvidence commented 1 year ago

This might help https://www.youtube.com/watch?v=VH1YBcVmM-M

BrodaNoel commented 1 year ago

Anybody fixed this?

vonovak commented 1 year ago

Hello and thanks for reporting, I cannot reproduce this so I'm going to close the issue. Sometimes it helps to just cold-boot the emulator / restart things.

Please open a new issue if the problem persists. Thank you 🙂

junaid-junnu commented 1 year ago

I'm fixed this issue. on putting this line in GoogleSignin.configure forceCodeForRefreshToken: true,

GoogleSignin.configure({ webClientId: "xxxxxxxxxxxxxxxxxxxxxxxxxx", offlineAccess: true, forceCodeForRefreshToken: true, iosClientId: "xxxxxxxxxxxxxxxxxxx" })