How can I build a webapp which uses google calendar api without having to become verified? - google-api

What I want to build:
I want to build a website where users can connect their google calendars (this will use Google Calendar API's)
and view their calendar events, as well as edit them, and create new ones.
My problem:
In order to do so, google says my app needs to be verified, which can take weeks, and I also need to set up terms of services pages, privacy policy pages
I also need to supply authorised javascript origins which MUST start with https, which of course is a problem during development, since my origin is http://localhost
I also need to set up support emails and homepage link
Question
I just want to start building my application without having to set up a whole production-ready website eco system.
Is there anyway I can use these Google Calendar APIs for editing/creating calendar events locally, without having to set up everything mentioned above first?

Unverified apps can still be used by the developer who created the project on google developer console.
Unverified app screen
The app or script might display an "unverified app" screen before it displays the consent screen. This is based on the specific scopes that your app includes in the request.
You can still work on your app while you are going though the verification process. However that being said i would start that process asap it can take a long time to get verified.

Yes, you can. As far as I am able to tell, all the verification step does is remove the "unverified app" screen. As long as you click Advanced > Go To ... (unsafe), you should be able to create and edit calendar events for that user in your application.
In order to be able to create and edit calendar events, you need to use the most sensitive scope, which is https://www.googleapis.com/auth/calendar. I couldn't figure out how to edit and create calendar events in my web app until I changed my scope from calendar.events to calendar.
Creating Events: https://developers.google.com/calendar/create-events

Related

Test GMail marketplace app flow

So here I am again, exploring new Google platform and hunting down information and docs.
I'm trying to build a skeleton of a flow before I write any business logic code with actual use of the APIs, and as expected from Google, this process is excruciatingly painful.
I've tried to follow this doc:
https://developers.google.com/gsuite/marketplace/listing
Packaged the zip, put the flag DOMAIN_INSTALLABLE flag as was instructed in order for the app to be installible from the marketplace. In the dashboard of PRICING & DISTRIBUTION I've selected Private and added testers to the list of testers.
Now when I click View in Chrome Web Store (seen in image) it takes me to the extensions web store, and not to the marketplace store.
How can I get to the GSuite Marketplace flow, rather than the extension flow? Do I need to alter my manifest.json in some way that is not mentioned in the docs?
Thanks
it's true that the publishing flow is too complicated now. We are working on improvements and in the future everything will be in one place.
Unfortunately G Suite Marketplace does not support trusted testers (yet), that's why it doesn't show up.
What you might be able to do, is modify the url a bit after you clicked on 'View in Chrome Web Store'.
Just remove everything after the webstore id
I use this url:
https://chrome.google.com/webstore/detail/xxxxxx
xxxx should be your webstore id
You should be able to show your unlisted app in the Gsuite Marketplace, where you can initiate the install flow.
It works for me, but my test app

Webhook when new domain installed my app

I'm working on GSuite application and wondered how my backend can be notified when new domain admin installs my app?
You can use the license notification api to retrieve a list of current installs. https://developers.google.com/apps-marketplace/v2/reference/licenseNotification/list
After installation the user will probably start or setup your app. You could add your own webhook notification when the user goes through this First Run Experience. (This is what we did)
There is another thing you might be able to pull off: As far as i know, an event is fired to Google Analytics on install. Maybe you can add an alert/webhook in Google Analytics.
However, i was having some problems with the events to show up in GA in the first place.

Check wether an user has used hangout before

Is there a way to check wether an user has used hangout before via API? I need it to build a report and promoting hangout within the organisations.
No, there is no API that tracks this.
Depending on your exact needs, you might be able to run an organizational hangout app when they start it, triggered by the start button, which would report they're using the app... but this isn't foolproof (it would ignore hangouts started via calendar, for example).

Create Docs through the Drive API with specific page setups (margins, orientation)

My app is already able to create Google Docs through the Drive API, and when doing so I can choose the title, data, and metadata. But I've been looking at the documentation and it seems there is no way to set some other properties of the Docs, such as the margins and the orientation (portrait or landscape) of the Docs being created. Is there a way to do so?
After not finding an answer in the documentation, the only thing I could think of was logging in with my Google Account, going to one of the created Docs, click on "Page setup", then select "Landscape", and finally "Set as default". I thought that by setting it as the default in my Google Account, it may happen that all the Docs created with it may be created as Landscapes. But it didn't work. A possible reason, however, is that the account actually creating the documents is a Service Account, not my regular Google Account. I guess both accounts, while being linked, are not the same thing, so the defaults of one don't apply to the other. Is there some way to set "Portrait" as the default orientation for the Docs created with my Service Account? If not, would the solution be to stop creating the Docs with my Service Account, and start creating them with my regular Google Account, so that the defaults I apply to them apply too to the newly created Docs?
Drive API doesn't support Docs related features for you to retrieve/set metadata about the documents.
Service accounts are individual Google accounts and no way related with your own user account. On the other hand, your default settings will only apply to you. You cant programatically set other user's defaults.
The best way I can think of, which is really a hack, is to make your own google docs API using headless chrome and pupeteer, which could be used only in part, and in connection with, the official docs API.
This is basically a web browser that runs on your server, which can be controlled to do anything a client would normally do on a web browser, like click buttons, submit forms, etc, only at the command of a server, which can be commanded through HTTP requests etc.
So after installing puppeteer, open the chromium browser, log into your google account, then open google drive with the server, and you should already be logged into the account. If not, you may have to log into the account using the server logic, which can get complicated with 2 step verification...
but anyway once you are logged into your google account on puppeteer, on drive.google.com, simply stay on that page and wait.
If the server receives some kind of HTTP request to make a new document, then have the server just literally click the new document button on the webpage, and it should open the new document in a new tab, which you should be able to access with puppeteer.
Then, when it is made, you can either just send the URL back to the request server, and / or make your page setup changes now, based on the data received in the HTTP request earlier.
For example, if, at one point (either after the document is created, or during its creation), there is some kind of message specifying the color of the background, just manually, on the server side, click File -> page setup, and select Custom, and, programmatically "type" the hex color code etc then click the OK button, then end the POST request.
If you have any questions, let me know
var doc = DocumentApp.getActiveDocument();
var body = doc.getBody();
//turn landscape if portrait
var oldHeight = body.getPageHeight();
if (oldHeight > body.getPageWidth()){
body.setPageHeight(body.getPageWidth());
body.setPageWidth(oldHeight);
}

Approve content aggregator app itunes

Hi
I've built an IOS app that has a tab bar and extracts content from a website and displays it.
I need it to be approved in itunes but when i sent it to review they replied
"We've completed the review of your app but cannot post this version to the App Store because it is only a content aggregator and provides a limited set of features and functionality to users"
I've read about it and i noticed that there are a lot of apps just like my app that are used by news sites and they were approved.
My content must be on a remote web server due to security reasons and i have complied with the reachibility protocol that apple requires which means that i monitor if there is network available on the device and warns the user that the content can only appear on connected ipad.
Is there a way that i can add approve my app or must i become a large news site in order to make my app approved?
Add searching or filtering of the content displayed in your app. That should do the trick.

Resources