gapi

The correct order to load Google Client api gapi and angular js

北战南征 提交于 2019-12-11 13:14:46
问题 It's kind of tricky how to load js files in an Angular project together with Google Client js api. This question is talking about the correct order of doing this. Angular Js and google api client.js (gapi) And there is an Official Doc talking about this, https://cloud.google.com/developers/articles/angularjs-cloud-endpoints-recipe-for-building-modern-web-applications/. One thing in the doc is that it uses window.init() inside of init which will be causing an infinite loop. As willlma pointed

google sign-in auth2 customize scope without openid

我与影子孤独终老i 提交于 2019-12-10 10:24:32
问题 I want to customize the scope to allow only "email" and "profile", without "openid" because I would like to making it asking only to access to email and basic profile info. I tried to do it using the meta: <meta name="google-signin-scope" content="email profile"> or the js: gapi.auth2.init({ client_id: 'xxxxxxxxx.apps.googleusercontent.com', scope: 'email profile' }); But it does not work: in the generated URL there is always the "openid" scope... How can I "reset" the scope, and allow only

Cannot read property 'style' of null - Google Sign-In Button

非 Y 不嫁゛ 提交于 2019-12-08 14:53:33
问题 I'm trying to implement Google sign in for my website. The Sign-In button shows up correctly and signs-people in well initially. My problem occurs when I log out after having used the website and try to move to the Sign-In page (I'm using React, so it's all one page). I use the exact same function to render the Sign-In page but it gives me a "cb=gapi.loaded_0:249 Uncaught TypeError: Cannot read property 'style' of null". The error in gapi occurs here (at least I think): a.El;window.document

How to use the Google API client for JavaScript with a One-Tap sign in flow?

天涯浪子 提交于 2019-12-08 08:03:21
问题 I'm using Google One-Tap sign in to authenticate users, and after the user is authenticated I get an access token. I know that I can use this access token in order to work with the Google API client for JavaScript ("GAPI"). But I can't find any way to work with GAPI using this access token. Is there any way to use GAPI assuming I already have an logged in user? What I'm trying to do is access the user calendar after simply authenticating with One-Tap authentication and giving consent for the

google sign-in auth2 customize scope without openid

老子叫甜甜 提交于 2019-12-06 00:31:32
I want to customize the scope to allow only "email" and "profile", without "openid" because I would like to making it asking only to access to email and basic profile info. I tried to do it using the meta: <meta name="google-signin-scope" content="email profile"> or the js: gapi.auth2.init({ client_id: 'xxxxxxxxx.apps.googleusercontent.com', scope: 'email profile' }); But it does not work: in the generated URL there is always the "openid" scope... How can I "reset" the scope, and allow only what I want? BasicProfile requires 'profile email openid' scopes. You can disable basic profile and

Google Drive API Application data accessing credentials from Web browser(Javascript)

人走茶凉 提交于 2019-12-05 00:54:31
问题 I'm trying to obtain credentials from Google Console to access my Application Drive data through Web browser(Javascript) option (In order to use Picker API latter on). But when I select option Application data(Access data belonging to your own application) I got the message: Application data cannot be accessed securely from a web browser. Please consider selecting another platform. Can anyone explain, why It is not secure, and how can I access my application data using Web browser, maybe

Google Drive API in Angular2/Ionic2 gapi.client.drive

我们两清 提交于 2019-12-04 16:59:01
I write Angular2/Ionic2 app to show list and upload file to Google Drive. Login with Google works fine but gapi.client.drive got undefined. What should I do to solution it or have method instead? I installed npm install --save @types/gapi npm install --save @types/gapi.auth2 And my code home.ts import { Component, NgZone } from '@angular/core'; import { NavController } from 'ionic-angular'; import { Http, Headers } from '@angular/http'; import { DriveService } from '../../services/drive.service'; @Component({ selector: 'page-home', templateUrl: 'home.html', providers: [ DriveService ] })

Google Drive API Application data accessing credentials from Web browser(Javascript)

拟墨画扇 提交于 2019-12-03 17:27:25
I'm trying to obtain credentials from Google Console to access my Application Drive data through Web browser(Javascript) option (In order to use Picker API latter on). But when I select option Application data(Access data belonging to your own application) I got the message: Application data cannot be accessed securely from a web browser. Please consider selecting another platform. Can anyone explain, why It is not secure, and how can I access my application data using Web browser, maybe should choose different credentials? Thanks. You can access your Google Drive Data in three possible ways:

How to make the file shareable using google drive api

感情迁移 提交于 2019-12-01 06:27:59
I am trying to get the file using google drive api, by default the file is not shareable i want to make it shareable. Here is my code:- <script type="text/javascript" src="https://apis.google.com/js/api.js"></script> <script src="https://apis.google.com/js/client.js"></script> // The Browser API key obtained from the Google Developers Console. // Replace with your own Browser API key, or your own key. var developerKey = 'XXXXXXXXXX_ff_NX66eb-XXXXXXXXXXX'; // The Client ID obtained from the Google Developers Console. Replace with your own Client ID. var clientId = "XXXXXXXXXX

How to make the file shareable using google drive api

不想你离开。 提交于 2019-12-01 03:51:26
问题 I am trying to get the file using google drive api, by default the file is not shareable i want to make it shareable. Here is my code:- <script type="text/javascript" src="https://apis.google.com/js/api.js"></script> <script src="https://apis.google.com/js/client.js"></script> // The Browser API key obtained from the Google Developers Console. // Replace with your own Browser API key, or your own key. var developerKey = 'XXXXXXXXXX_ff_NX66eb-XXXXXXXXXXX'; // The Client ID obtained from the