@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