How to reproduce UserRecoverableAuthIOException on Android device? - google-drive-realtime-api

When I debug with Google Drive API, I met this problem:
First time when I call service.about().get().execute(); in my app, it will catch UserRecoverableAuthIOException and my code call startActivity.
But after I confirm the auth dialog , it never show up again.
I want to debug the whole auth routine, but how to erase auth data and let it raise the exception again?

Just unconnect the app from where the Google service you use, such as the "Manage apps" setting in Google Drive webpage.

Go to https://accounts.google.com/IssuedAuthSubTokens to revoke access of the app and expect the exception again.

Related

Test Suite for Smart Home don't execute action

I am trying to execute Test Suite to certify, but I receive an error when executing the action. I can't find anything in the Google Cloud log. Everything works fine using Google Assistant on my phone and Nest.
enter image description here
A 503 error code means that the requested service is temporarily unavailable at the moment. You can wait for some time before trying again & make sure that your Smart Home Actions are linked with an account & testing is enabled for your actions. For instructions on how to set up your account for testing, check this link.
If the issue still persists, open up a ticket on our Public Issue Tracker.

Webview missing from Chrome

We have an embedded microApp that is setup on a thirdparty website (Saba) that is designed to pass a session token to our Application. We are initiating a User login by presenting them an embedded browser session using WebView2 in our wpf application. Then after a successful login the microApp on the Saba homepage passes back a session token. This appears to be where the application is hanging, waiting for the valid session token to be returned.
This had been working great up until the last 24 hrs, when we are experience hangs on logging in. It appears that trying to access webview via the console/inspector from Edge doesn't work either. "window.chrome.webview" shows undefined.
We are actively scouring any reference we can find to see if there is information about webview support being deprecated or moved but we haven't yet. If anyone has any ideas or resources of where we may be able to find some answer that would be much appreciated.

Web3-React: Walletconnect does not set active and account in useWeb3React hook

Bug Description
The issue is that when I use walletconnect to connect, I get the walletconnect qr modal to open fine. The modal also closes when the qr code is scanned from and connected from trustwallet and metamask app on my android phone. But I am console logging the account and active variables from useWeb3React hook, and they come up as undefined.
This is not the problem with injected as I can see the account and active is also set as true after I connect.
Reproduction
Codesandbox Link
Expected Behavior
Active is set to true and account is set to wallet address
I was able to connect with WalletConnect to your reproduction app using Metamask and TrustWallet from my Android device, and from a Desktop app (Infinity Wallet), so your code is fine.
Screenshot of connection.
Double check that you're connecting correctly in the Android app (hit connect), and that your accounts are legit (e.g. fully signed-up, security setup, etc.). Having a balance in your accounts doesn't matter.
Import error and setError from useWeb3React along with the others you're already importing. Use setError where you think the issue might be happening, then display it using error similarly to how you're displaying active.

Use path/slug after Web App's base url in Google Apps Script

I'm looking to make the url by adding a path which is something like this below in Google Apps Script:
https://script.google.com/macros/s/APP_ID/exec/fileName.txt
How can I achieve this for Web App service?
I believe your goal as follows.
You want to access to Web Apps using the URL of https://script.google.com/macros/s/APP_ID/exec/fileName.txt.
For this, how about this answer? I think that you can achieve your goal using Web Apps. As a sample case, I would like to explain about this using a sample script for downloading a text file, when an user accesses to https://script.google.com/macros/s/APP_ID/exec/fileName.txt.
Usage:
Please do the following flow.
1. Create new project of Google Apps Script.
Sample script of Web Apps is a Google Apps Script. So please create a project of Google Apps Script.
If you want to directly create it, please access to https://script.new/. In this case, if you are not logged in Google, the log in screen is opened. So please log in to Google. By this, the script editor of Google Apps Script is opened.
2. Prepare script.
Please copy and paste the following script (Google Apps Script) to the script editor. This script is for the Web Apps.
function doGet(e) {
const path = e.pathInfo;
if (path == "filename.txt") {
const sampleTextData = "sample";
return ContentService.createTextOutput(sampleTextData).downloadAsFile(path);
}
return ContentService.createTextOutput("Wrong path.");
}
In order to retrieve the value of fileName.txt in https://script.google.com/macros/s/APP_ID/exec/fileName.txt, please use pathInfo.
For example, when you check e of doGet(e) by accessing with https://script.google.com/macros/s/APP_ID/exec/fileName.txt, you can retrieve {"contextPath":"","contentLength":-1,"parameter":{},"parameters":{},"queryString":"","pathInfo":"fileName.txt"}.
In this case, the GET method is used.
3. Deploy Web Apps.
On the script editor, Open a dialog box by "Publish" -> "Deploy as web app".
Select "Me" for "Execute the app as:".
By this, the script is run as the owner.
Select "Anyone, even anonymous" for "Who has access to the app:".
In this case, no access token is required to be request. I think that I recommend this setting for your goal.
Of course, you can also use the access token. At that time, please set this to "Anyone". And please include the scope of https://www.googleapis.com/auth/drive.readonly and https://www.googleapis.com/auth/drive to the access token. These scopes are required to access to Web Apps.
Click "Deploy" button as new "Project version".
Automatically open a dialog box of "Authorization required".
Click "Review Permissions".
Select own account.
Click "Advanced" at "This app isn't verified".
Click "Go to ### project name ###(unsafe)"
Click "Allow" button.
Click "OK".
Copy the URL of Web Apps. It's like https://script.google.com/macros/s/###/exec.
When you modified the Google Apps Script, please redeploy as new version. By this, the modified script is reflected to Web Apps. Please be careful this.
4. Run the function using Web Apps.
Please access to https://script.google.com/macros/s/###/exec/filename.txt using your browser. By this, a text file is downloaded.
Note:
When you modified the script of Web Apps, please redeploy the Web Apps as new version. By this, the latest script is reflected to the Web Apps. Please be careful this.
References:
Web Apps
Taking advantage of Web Apps with Google Apps Script
Updated on February 14, 2023
In the current stage, it seems that pathInfo can be used with the access token. It supposes that the following sample script is used.
function doGet(e) {
return ContentService.createTextOutput(JSON.stringify(e));
}
When you log in to your Google account and you access https://script.google.com/macros/s/###/exec/sample.txt with your browser, {"contextPath":"","parameter":{},"pathInfo":"sample.txt","contentLength":-1,"parameters":{},"queryString":""} can be seen.
In this case, when you access it without logging in Google account, even when Web Apps is deployed as Execute as: Me and Who has access to the app: Anyone, the log in screen is opened. Please be careful about this.
And, if you want to access with https://script.google.com/macros/s/###/exec/sample.txt using a script, please request it by including the access token. The sample curl command is as follows. In this case, the access token can be used as the query parameter. Please include one of the scopes of Drive API in the access token.
curl -L "https://script.google.com/macros/s/###/exec/sample.txt?access_token=###"
By this, the following result is returned.
{"contextPath":"","queryString":"access_token=###"},"pathInfo":"sample.txt","parameters":{"access_token":["###"]},"contentLength":-1}

on what error log settings can I find app error logs that google clould compute engine apps throw

I've deployed an app using googles cloud compute engine service.
I get an error when I try to register a new user:
We're sorry, but something went wrong. If you are the application owner check the logs for more information.
I'm in the logs section of the google cloud console and it has all sorts of random logs I can look at but I cant find where the errors that the app coding itself caused caused are put, e.g. I'm sure its a mail configuration problem that is causing the error message for new registered users but I cant fix the problem until I find out what the actual error is.
Where exactly are actual app errors put, because they aren't displayed on the page the like in production on my local computer. (I'm using a rails app if that makes a difference to anything)
All errors are logged in the logging section, try applying filters or sorting the logs by date. Sometimes they take a little while to appear.

Resources