Google Drive SDK - DrEdit Python - Web Store Manifest - google-drive-api

I've been trying to work through the DrEdit python example for the Google Drive SDK. When I get to step 4, create a web store listing, I'm encountering a problem. I modified the manifest.json file as described. However, after I create the manifest.zip file, I am unable to upload the manifest archive from the web store developer dashboard. I receive the following error message:
"An error occurred: Invalid manifest. If your manifest includes comments, please remove them as our gallery does not support them yet."
Now, if I remove the 'container' and 'api_console_project_id' entries from the manifest, it uploads fine. However, without these entries, the DrEdit application will not be "integrated into Google Drive", correct?
I also tried to install the manifest in Google Chrome directly (developer mode). In this case, I get warnings about the two entries in question (not recognized).
How do I resolve this issue? Is it possible that the "Setting up the sample application" documentation is out of date?
(edit)
Manifest File:
{
"name" : "DrEdit",
"version" : "1.0.0.0",
"manifest_version": 2,
"description" : "Test Google Drive application",
"container" : "GOOGLE_DRIVE",
"api_console_project_id" : "dpederson-gae-dredit-api",
"icons": {
"128": "icon-128.png"
},
"app" : {
"launch" : {
"web_url" : "https://dpederson-gae-dredit.appspot.com"
}
}
}

The api_console_project_id field is invalid. It should match the App ID value from the Drive SDK tab of the APIs Console, the one you got when registering the app as explained at https://developers.google.com/drive/register

It should match the CLIENT_ID. More exactly the xxxxxxxx part from the xxxxxxxxx.apps.googleusercontent.com

Related

Where can you find or how can you create a chrome extension key and place it in your manifest.json file?

Looking to implement Oauth2 in my Chrome extension
I have been researching how to implement oauth2 on a chrome extension. I have been stuck for quite some time. I eventually got information to use chrome.identity in my background.ts file.
Here is my manifest.json
...
"permissions": [
"identity"
],
"oauth2": {
"client_id": "855289137547-bd37ghe68neqevqs47esitvc99rb5f8d.apps.googleusercontent.com",
"scopes":["https://www.googleapis.com/auth/userinfo.email"]
},
"background": {
"scripts": [
"background.js",
"runtime.js"
]
},
...
Call the chrome.identity API
There is a method on the API that is called getAuthToken which I am trying to call. When I try to call this method I get the following:
// background.ts
chrome.identity.getAuthToken({ interactive: true }, (token) => {
// store token here
});
Error
Unchecked runtime.lastError: OAuth2 request failed: Service responded with error: 'bad client id: 855289137522-bd37ggg68neqevqs47esitvc99rb5f8d.apps.googleusercontent.com'.
I checked multiple times and I can confirm that that the id is the same as I my console developer credentials.
Maybe it needs a key in the manifest
I was assuming that I have to have a key in my manifest.json. So, I followed the documentation at the following link where it says to follow the steps:
At the Developer Dashboard, click Add new item.
Click Choose file and select the .zip extension directory and upload it.
Without filling in additional fields, select Save Draft and return to dashboard.
Find the extension under Your Listings and click on more info. From the popup, copy the public key and add it to the manifest inside the unzipped directory under the "key" field.
However, I looked everywhere but could not find the "more info" link or any other info leading me to a key.
Key is available in the new UI --> Package on left side menu --> Public Key
At of time of my post (August 2020), if you go to the Developer Dashboard, you will always be directed to the new UI, which doesn't contain the More Information section, which means you can't find the public key.
AFAIK there is no other way to get the public key. You can't substitute your application ID because it is a hashed version of the public key,
Look for the Welcome popup on the bottom left corner of the screen and click on opt out link in tiny font to revert to the legacy interface.

Azure Function does not execute in Azure (No Error)

I created an Azure Function App to send emails (uses service bus topics), and I have it working beautifully locally using their SDK/CLI tools, but when I publish it to Azure using the Visual Studio Publish options available, the function doesn't appear to run, there is no error, and the monitor shows "No Data Available". The only thing I can possibly think of is that perhaps the local.settings.json file which allows me to run the app locally needs to be manually entered some place into the function app?
Clicking Run next to function.json just tells me in the Logs "2017-12-01T16:59:21 Welcome, you are now connected to log-streaming service." no other information is presented. Also, I checked the topic and still have messages pending.
I have verified the files did publish successfully to the bin folder using Kudo, and the function.json (below) looks right to me. Does anyone have any ideas why this might not be triggered and isn't erroring? As a note, the function folder only has function.json in it, but up one level the bin folder and the dll shown in the json are there.
function.json:
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.0.0",
"configurationSource": "attributes",
"bindings": [
{
"type": "serviceBusTrigger",
"topicName": "topicemail-dev",
"subscriptionName": "subLowPriority",
"accessRights": "manage",
"name": "mySbMsg"
}
],
"disabled": false,
"scriptFile": "..\\bin\\Emailer.dll",
"entryPoint": "Emailer.Functions.LowEmail"
}
When deployed to Azure, Functions does not use local.settings.json. Instead, it reads values from the App Settings. All you need to do is add App Settings values for each of the properties you have in local.settings.json
For people with the same issue, but who still can't get it working with the selected answer, view Azure function implemented locally won't work in the cloud , it might help.

How does chrome.browserAction work?

Im trying to develop my first chrome extension and am running into an issue. Firstly I am using the following boilerplate as a page action:
http://extensionizr.com/!#{"modules":["browser-mode","with-persistent-bg","no-bg","with-custom-options","no-override","inject-css","inject-js","jquerymin"],"boolean_perms":["contentSettings","cookies","notifications"],"match_ptrns":[]}
In the inject.js, it downloads a list of urls from a remote server, checks the current url and if it matches it should do something. I was going to use a notification but I guess the notification comes from the current page and not the extension. So if you start the notification it will say "Do you want to enable notifications for amazon". Then I moved on to changing the icon. I would prefer doing both eventually. However, when I try and set text with the following:
chrome.browserAction.setIcon({path: 'icons/icon128-x.png'});
However, this is what I get in the console.
Uncaught TypeError: Cannot read property 'setIcon' of undefined
Any ideas?
you can't access chrome.browserAction in content.js, according to chrome extension document Content Scripts
Additionally, content script can access the following chrome APIs directly:
i18n
storage
runtime:
connect
getManifest
getURL
id
onConnect
onMessage
sendMessage
Content scripts are unable to access other APIs directly.
The extension manifest needs a "browser_action" section before the chrome.browserAction API is available to it:
Register your browser action in the extension manifest like this:
{
"name": "My extension",
...
"browser_action": {
"default_icon": { // optional
"19": "images/icon19.png", // optional
"38": "images/icon38.png" // optional
},
"default_title": "Google Mail", // optional; shown in tooltip
"default_popup": "popup.html" // optional
},
...
}
(From https://developer.chrome.com/extensions/browserAction#manifest.)

Is it possible to create multiple Chrome Hosted Apps for the same domain?

Our product has both a free component, and a full featured, subscription based web application. I've created a Chrome Hosted App - essentially an installable bookmark - for each both of those parts of our product.
The interesting parts of the app manifests are as follow:
"manifest_version": 2,
"app": {
"launch": {
"container": "tab",
"web_url": "https://paydirtapp.com/dashboard"
}
}
"manifest_version": 2,
"app": {
"launch": {
"container": "tab",
"web_url": "https://paydirtapp.com/free_invoice_creator"
}
}
I can install the free invoice creator app, and the full featured app, but not both at the same time.
Attempting to do so (in Chrome 26.0.1410.10 (Official Build 183151) dev) causes the following error message:
"An error has occurred. Could not add the application because it conflicts with "Free Invoice Maker".
The only reference I can find to this issue is in https://developers.google.com/chrome/apps/docs/developers_guide#manifest, where they state the following:
Important: If you provide multiple apps, avoid overlapping URLs. If a user tries to install an app whose "web_url" or "urls" values overlap with those of an already installed app, the second installation will fail due to URL conflict errors. For example, an app that specifies a "urls" value of "http://mail.example.com/" would conflict with an app that specifies "http://mail.example.com/mail/".
Previously, my web_url value was just set to https://paydirtapp.com/, which caused the same error. I expected that updating it so that it wasn't a substring of the other app would solve the problem, but it hasn't.
Does anyone know if it's possible to have multiple Chrome Hosted Apps where the web_url is for the same domain?
Answer from Moshe Matz (copy from comment):
Using separate subdomains for each app should work.
For example, use https://dashboard.paydirtapp.com and https://free_invoice_creator.paydirtapp.com. You will likely need a new SSL certificate that contains both of those names.
Separate subdomains should work. We don't currently have a solution for the same domain case.

How can I include TTS in a Chrome App?

I'm trying to use text-to-speech in a Chrome app, but I'm getting an error when trying to load the app.
My manifest.json looks like this:
{
"name": "APPNAME",
"description": "DESCRIPTION",
"version": "3",
"app": {
"urls": ["APPURL"],
"launch": {"web_url": "APPURL"}
},
"icons": {"24": "icon24.png", "128": "icon128.png"},
"permissions": ["tts"]
}
The error I'm getting reads "Could not load extension from <PATH>. Access to permission 'tts' denied."
Removing the "app" part of the manifest seems to allow it to load without problems. That would make me think that TTS is limited to Chrome extensions, but the docs suggest otherwise. Changing the "tts" permission to the "cookies" permission results in the same error, but changing it to "clipboardRead" does not.
I'm attempting to load the app via: Tools > Extensions > Load unpacked extension, and I'm using Chrome 16 on Ubuntu 11.10.
Can anyone tell me what I'm doing wrong?
It turned out that some permissions are only available for extensions and packaged apps. I was trying to use tts with a webapp, which is unfortunately not available.
That said, the Web Speech API is now available, along with Speech Synthesis.