As you may know, I have, along with many others, both before and after me, developed different methods and opportunities to connect AI2 to "Google things", in the main; Drive and Sheets. The one sticking point with this has always been that the Drive or Sheets in question are always "owned" by the app developer.
The issue with using google apps script to create a web app, in order to connect things up, is that it requires a "proper" web browser for the user to authenticate, and also in an unverified state, presents some unpalatable dialogs and warnings to the user.
Because the google web app must be run as "the user who accesses the app", in order for the user to access their own account and google drive, it is not possible to use 0Auth2 libraries to run with the web component, or keep things inside the app, and also the fact that the native webview will not handle the web app authentication due to Google's changes in this area a couple of years ago. However, it is possible to authenticate the web app (give permission) using the device browser (e.g. Chrome), then use the native webviewer to carry out the GET requests, once signed in to Google.
I created a web app that required the "restricted" scopes for Drive/Sheets/Documents/Slides, and submitted it for verification by Google. It came back verified after 24 hours (they say 4-6 weeks is normal). This now means that although authentication is still required, it is a slightly more pleasing process for the end user of an app. As a part of the verification process, I have created a product page and privacy policy for end users and app developers. I have also created a demo app that shows the authentication process and how the web app works.
I believe that this has got "legs", will be of use to many AI2 developers, and can think of many reasons for end users to feel more comfortable, or to find things more practical, to have their data on their Google Drive/Sheet etc.
Provided directly is a DEMO APP for you to try which offers a few of the 26 available functions (to date). I strongly recommend you read the documentation (which is also available in the app itself). When testing the demo app, it is best to have your google drive open on a computer, in order that you can observe the changes. (the best bit!)
A full version apk (all functions so far) is available upon request through registration. Interested developers can also register for a base aia and the web app link in order that they can develop their own applications. Registration with me is required in order that I can provide support, assistance and upgrades. I cannot “open source” everything, given the inherent authentication requirements put in place by Google, but for those that wish to create their own web app, I will be happy to show them how it was done.
DIRECT LINK TO REGISTRATION FORM
My thanks go out to @GC1, @Taifun, @DanHG & @HarryGC for beta testing along the way.
No extensions were required for the authentication process, however I did use @vknow360’s FileTools and Filey extensions to improve the use of the various functions (file picking and base64 conversion). Thank you, Sunny, for your work. Accreditation also to MIT App Inventor for the kodi “bee” logo, used in my logo.
Note: in testing, I have observed (so far...) three different behaviours from Chrome/Google when initially authenticating the google web app(GDConnector):
- As seen in my phone/emulators and shown on the website images
- Automatic authentication with no need for the user to login (although they have to login inside the app)
- When user not logged into their account in Google, once logged in, not need to log in again to complete authentication (although they have to login inside the app)
The android app is developed and tested in MIT App Inventor. It may work in other distributions.