Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sign in with youtube.readonly scope works on iOS but infinite loading screen on Android #993

Open
Eliajn opened this issue Sep 29, 2021 · 1 comment

Comments

@Eliajn
Copy link

Eliajn commented Sep 29, 2021

Steps to Reproduce

I am using Sign in with Google to fetch the youtube channels of a specific user; for that I only need the following scope
https://www.googleapis.com/auth/youtube.readonly.

These credentials are working for IOS but it is returning Developer-error with code 10 for android.

I added the google_services.json generated from firebase, which includes the Web Cient id.
On google console:

  • I added the https://www.googleapis.com/auth/youtube.readonly on the OAuth consent screen,
  • App type is external in testing mode, and I added my emails as testing users

Im am using the following code to sign in, this allows us to choose an account, but gets stuck on an infinite loading screen, as shown in the screenshot below.

GoogleSignin.configure({
      scopes: [ 'https://www.googleapis.com/auth/youtube.readonly'],
      webClientId: '*******',
       offlineAccess: false,
      forceCodeForRefreshToken: true, 
    });
   try {
      await GoogleSignin.hasPlayServices();
      await GoogleSignin.signOut();
      const userInfo = await GoogleSignin.signIn();
      console.log('userInfo: ', userInfo);
    } catch (error) {
      console.log(error)
    }

Screen Shot 2021-09-29 at 5 19 18 PM

In the following code, offlineAccess is set to true, i get developer error with code 10.

GoogleSignin.configure({
      scopes: [ 'https://www.googleapis.com/auth/youtube.readonly'],
      webClientId: '*******', 
      offlineAccess: true,
      forceCodeForRefreshToken: true, 
    });
   try {
      await GoogleSignin.hasPlayServices();
      await GoogleSignin.signOut();
      const userInfo = await GoogleSignin.signIn();
      console.log('userInfo: ', userInfo);
    } catch (error) {
      console.log(error)
    }

Screen Shot 2021-09-29 at 6 01 29 PM

Expected Behavior

Screen Shot 2021-09-29 at 6 10 21 PM

Actual Behavior

on Android Screen gets stuck after choosing a gmail account
Screen Shot 2021-09-29 at 5 19 18 PM

Environment

Please provide

  • react-native version: 0.64.0
  • @react-native-google-signin/google-signin version: ^7.0.0-alpha.3
  • Android:
    buildToolsVersion = "29.0.3"
    minSdkVersion = 21
    compileSdkVersion = 29
    targetSdkVersion = 29
    ndkVersion = "20.1.5948944"
    supportLibVersion = "28.0.0"
    googlePlayServicesAuthVersion = "16.0.1"
    'com.google.gms:google-services:4.3.8'
@vonovak
Copy link
Member

vonovak commented Oct 2, 2021

hello and thanks for reporting.

It's possible some more native code has to be added for this to work but I'm not 100% sure.

also this might help: #988

#941

Also please note I'm currently not adding new features (#942).

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants