Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70432

ERROR TypeError: Cannot read property 'signIn' of null in ionic3

$
0
0

@zaiinali96 wrote:

I used ionic3 to develop a app. i want to like a youtube video from my app. For this, i used Youtube Data Api.

gapi.auth2.getAuthInstance() works fine on ionic lab and show a popup window to authenticate but when app run on android mobile gapi.auth2.getAuthInstance() give error " ERROR TypeError: Cannot read property ‘signIn’ of null ".

Please someone suggest solution for this error.

Code:

authenticate() {

  gapi.load('client:auth2', res => {
    gapi.auth2.init({
      client_id: "",
      scope: "https://www.googleapis.com/auth/youtube.force-ssl"
    });
  });

  gapi.auth2.getAuthInstance()
    .signIn({
      client_id: "",
      scope: "https://www.googleapis.com/auth/youtube.force-ssl"})
    .then((a) => { 

      console.log("Sign-in successful",a);
    }).catch(err => {console.error("Error signing in", err) });
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70432

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>