Gmail Contextual Gadget (Gmail plugin/extension): Deprecated? Impossible? How? (Can't do OAuth 2.0)

走远了吗. 提交于 2019-12-02 17:38:21

The documentation for Google Contextual Gadgets is a bad joke- outdated and wrong, don't waste your time.

The answers here on SO got me closer, but I never actually got the thing working.

Luckily I ended up finding gmail.js, which allowed me to write a Chrome extension to do what I needed...

1- Download the Gmail Chrome Extension Boilerplate project, which is a Hello world example chrome extension using gmail.js.

2- Update the main function in the main.js file to something like this:

var main = function(){

    gmail = new Gmail();
    gmail.observe.on("open_email", function(id, url, body, xhr) {

        // Inject a toolbar:
        var $email_body = gmail.dom.email_body();
        $email_body.prepend('<div class="my_toolbar"><a>Do something</a></div>');
    });
}

That'll give you this:

Had the same issues as well. I (barely) managed to have my gadgets up on my domain emails via the steps below. Here's what I can share;

1) Created a project via (https://console.developers.google.com). Switched on Marketplace SDK under the APIs side navigation menu. Once it's switched on, go at the top of the page and click on the 'gear cogs' for Google Apps Marketplace SDK. This will lead you to a page with a link for (Go to the original console). Click on the link.

2) You should be forwarded into a form page. Fill in all the required fields in the form. Check on the COB extension and declare your extractor ID(I used the pre-canned extractor, haven't tested it out with custom extractors) under text-field Extractor Url, your gadget url via text field Gadget Url, and select the scopes. Click on the Add button, and then the Save changes button once you're done.

3) Go to the API Access menu, and create an OAuth 2 Client ID.

Here's where the steps aren't clear for me, but I'll share what I did to have the gadgets available on my domain.

3) I clicked on the Test Install Flow button on top of the form..

4) I added the admin user as the editor for this project.

5) I then had to log out, clear cache, log in as the admin/domain user to see the contextual gadget at the bottom of the email.

Hope this helps.

The way described at https://developers.google.com/gmail/contextual_gadgets seems to be totally outdated. Even the form in the Google Apps console for gadgets seems to be outdated.

You need to follow this description: https://developers.google.com/apps-marketplace/preparing

Contextual Gadgets are now developed using the API console (not app console) and there is a form to create the extractors etc.

Please follow the below steps:

  1. Login in to your admin Gmail
  2. open new tab and type http://console.developers.google.com
  3. Click API section from the left panel of your Gmail
  4. Select the following APIs
    i. gmail API
    ii. Google Marketplace API
    iii. Calendar API
    iv. Google Admin SDK
  5. After Enabling all the above APIs please Open the Google Apps Marketplace SDK and click on Configure link(You have to generate the client ID)
  6. Fill the data with appropriate data, you need to upload the proper size images also
  7. Fill all the Required fields and Add the extractors as Google suggested.
    i) param name should be as per contextual API and value for all is ".*" otherwise gadget will not appear in gmail
  8. Enable the Universal Service URL
  9. Enable the COB extension
  10. Add the Gmail Contextual Gadget Extractors , you can add the multiple extractors for the Gadget but the Gadget URL should be same to the all extractors
  11. You can add multiple scopes for every extractor
  12. Save the all changes.

That's all !

You can follow the below link for your reference: https://developers.google.com/apps-marketplace/preparing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!