Hello.
Tried to implement google picker for my react app. First, I'm loading script and initialising google api
loadScript('//apis.google.com/js/api.js', () => {
window.gapi.load('picker', () => {
})
window.gapi.load(
'client:auth2',
() => {
window.gapi.auth.authorize(
{
client_id: googlePickerCredentials.clientId,
scope: googlePickerCredentials.scope,
immediate: true
},
authResult => {
console.warn(authResult)
}
)
},
10
)
})
First: It's working like a charm if user already logged in google. If user not logged, I see some strange requests.

Why?
Second: I need to sign in user if user not logged, so I'm using code from your authSample.
gapi.auth2.getAuthInstance().signIn();
It's weird, but gapi.auth2.getAuthInstance() returns always null
I found signIn function inside window.gapi.auth, but when I'm tried to run it
window.gapi.auth.signIn({
client_id: googlePickerCredentials.clientId,
cookiepolicy: 'single_host_origin',
callback: result => {
console.warn(result)
}
})
I receive error in console
Missing required parameter 'client_id'
Tried to use code from sample again
gapi.client.init({
apiKey: googlePickerCredentials.developerKey,
clientId: googlePickerCredentials.clientId,
scope: googlePickerCredentials.scope
}).then(function () {
console.warn('init finish');
});
but it not helps. btw, I never passed inside then section in that case
Hello.
Tried to implement google picker for my react app. First, I'm loading script and initialising google api
First: It's working like a charm if user already logged in google. If user not logged, I see some strange requests.
Why?
Second: I need to sign in user if user not logged, so I'm using code from your
authSample.gapi.auth2.getAuthInstance().signIn();It's weird, but
gapi.auth2.getAuthInstance()returns alwaysnullI found
signInfunction insidewindow.gapi.auth, but when I'm tried to run itI receive error in console
Missing required parameter 'client_id'Tried to use code from sample again
but it not helps. btw, I never passed inside
thensection in that case