1

I am using google API's in my angular 8 website. I have to integrate Google Drive and YouTube account on different buttons.

  1. YouTube Connect button
  2. Google Drive Connect button

I init gapi as

  initGoogleAccounts() {
gapi.load('auth2', () => {
  this.googleUser = gapi.auth2.init({
    client_id: this.env.google_client_id,
    fetch_basic_profile: false,
    scope: 'profile'
  });
});

}

On Youtube button click

    this.googleUser.grantOfflineAccess('https://www.googleapis.com/auth/youtube.force-ssl').then(({code}) => {
  this.youtubeCodeConnect(code);
});

But this is not asking for Youtube permissions. Is there anything which i am doing wrong?

Puneet Uppal
  • 195
  • 10

0 Answers0