google-api-client

Detect revoked permission for App in Google API

≡放荡痞女 提交于 2019-12-21 21:00:32
问题 I am using the PHP Google client library. I successfully get a token and refresh token from user/google to use with the API. As soon as the user revokes the permission for my website in Googles settings on the Google page i get following error: Error calling GET https://www.googleapis.com/calendar/v3/users/me/calendarList: (401) Invalid Credentials That is expected behavior since the user revoked my permission. However, how do I detect that a user revoked that access? Currently i do the

When should I disconnect GoogleApiClient (Android)

跟風遠走 提交于 2019-12-21 20:29:09
问题 In my android app, I have 3 login options. Google+, Facebook, and my own login option. I've implemented all 3. I've implemented Google+ login using the steps outlined here. Server side access is enabled. I get the one time authorization code and pass it to my own api. Once I've received the authorization code, is there any reason to keep GoogleApiClient connected? I have a similar question for Facebook Session here. 回答1: There is no reason to keep connected to the GoogleApiClient unless you

Android Wear CapabilityApi cannot find handheld capabilities

两盒软妹~` 提交于 2019-12-21 17:39:10
问题 I'm attempting to use MessageAPI to communicate back and forth between my handheld app and wearable app. I can't get the communication to work. I can confirm the devices are connected, but when my code executes, it acts like neither app has registered the Capability I am requesting. notifications are successfully sent from handheld to the wear device Wearable.NodeApi.getConnectedNodes(mGoogleApiClient).await() returns a list showing the handheld or wearable is indeed connected Wearable

Google Auth API Javascript idpiframe initialization error on Chrome

ぃ、小莉子 提交于 2019-12-21 06:57:47
问题 I use GSuite and I'm coding a very simple web app to use Google Auth API, and I get an exception "idpiframe_initialization_failed". Now I have the exact HTML as shown in the google Sample: https://developers.google.com/api-client-library/javascript/samples/samples 1) I've created a project on the Google Developer Console 2) I setup the OAUTH authorization screen 3) I've created the client ID, creating restrictions and redirection URL 4) I've also created the API KEY 5) Finally I've enabled

GoogleApiClient onConnectionFailed with statusCode=SIGN_IN_REQUIRED

扶醉桌前 提交于 2019-12-21 02:34:46
问题 I'm trying to connect my app to Google play service to access Google Drive but It showing me connection failed with statusCode SIGN_IN_REQUIRED. But it seems to behave like that just 3 days ago. I am also checked developer console of google. They may have changed something in the API which i am unable to figure out. Your help will be welcome. My Code: /** * Create a new file and save it to Drive. */ private void saveFileToDrive(final byte[] data) { // Start by creating a new contents, and

How to integrate google+ sign in my android app?

霸气de小男生 提交于 2019-12-20 16:55:16
问题 Hello all actually i need to sign in people from google+ through my app now i read documentation on google where it isstated that To allow users to sign in, integrate Google Sign-In into your app. When you initialize the GoogleApiClient object, request the PLUS_LOGIN and PLUS_ME scopes mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Plus.API) .addScope(Scopes.PLUS_LOGIN) .addScope(Scopes.PLUS_ME) .build(); Now i

Google Api Client already managing with id 0

放肆的年华 提交于 2019-12-20 04:52:55
问题 I want to connect GoogleApiClient in activity. It works fine when user click button first time and this dialog appears but when user press back button and reclick the button that responsable for initializing GoogleApiClient , I get this error java.lang.IllegalStateException: Already managing a GoogleApiClient with id 0 Here is my GoogleApiClient implementation private fun initGoogleApiClient() { mGoogleApiClient = GoogleApiClient.Builder(this) .addApi(Fitness.RECORDING_API) .addApi(Fitness

Google OAuth: can't get refresh token with authorization code

大憨熊 提交于 2019-12-20 02:53:11
问题 I am using Google API Client for Google Analytics with OAuth 2.0 I read this to get the refresh token but it doesn't appears: https://developers.google.com/identity/protocols/OAuth2WebServer#offline I only get this instead: { "access_token": "ya29.twHFi4LsiF-AITwzCpupMmie-fljyTIzD9lG8y_OYUdEGKSDL7vD8LPKIqdzRwvoQAWd", "token_type": "Bearer", "expires_in": 3599, "id_token": "very long string" } Here is the code: Javascript (to get the Authorization Code): that works gapi.analytics.ready

GoogleApiClient is not connected yet, even though onConnected is called and I'm creating my GoogleApiClient in onCreate

穿精又带淫゛_ 提交于 2019-12-20 02:32:26
问题 I looked at this Q&A here: GoogleApiClient is throwing "GoogleApiClient is not connected yet" AFTER onConnected function getting called As it seemed to be similar to what I was experiencing but, it's not. The issue with that user was that they were declaring their api client in the onStart() method, I create mine in the onCreate() method like suggested by the answer. I am still however, getting the same error. Here is the code I have for these three methods: protected void onCreate(Bundle

Silent Google Sign In in android background service

强颜欢笑 提交于 2019-12-18 16:34:15
问题 I am running a background service in my android app. I use the IdToken that I get from the sign in activity to authenticate at the backend server. The service is running in START_STICKY mode, so even when the app is closed, the service keeps running in the background to get any notifications from the backend server. The problem I'm facing is when the IdToken expires, I am not able to renew it in the service itself. The callback function does not receive any result if the token has expired. If