google-apps-scriptgoogle-cloud-platformgoogle-drive-apimanifestgoogle-apps-marketplace

How can I start testing my Google Drive UI integration?


I started developing a Google Drive UI integration, and I am having a rather basic problem. I cannot find the option to start testing my integration.

I have done the following so far:

What else do I have to do to get my integration to show up in the Google Drive? I can add published public add-ons to my Google Drive, but for some reason I am unable to start using my new project. Where can I find it?


Solution

  • Answer

    There are two types of add-ons:

    Since your add-on is an add-on that simply opens a document in our web app you are looking for a Workspace Add-on so in order to manually install your add-on without using a G-Suite Domain. You should deploy your Apps Script project from manifest as mentioned in this Quickstart.

    Keep in mind that the previous quickstart is following the Legacy Apps Script Editor. This example has a manifest file example appsscript.json which looks like:

    {
      "timeZone": "America/New_York",
      "dependencies": {
      },
      "exceptionLogging": "STACKDRIVER",
      "oauthScopes": [
        "https://www.googleapis.com/auth/calendar.addons.execute",
        "https://www.googleapis.com/auth/calendar.readonly",
        "https://www.googleapis.com/auth/drive.addons.metadata.readonly",
        "https://www.googleapis.com/auth/gmail.addons.current.action.compose",
        "https://www.googleapis.com/auth/gmail.addons.current.message.readonly",
        "https://www.googleapis.com/auth/gmail.addons.execute",
        "https://www.googleapis.com/auth/script.locale"],
      "runtimeVersion": "DEPRECATED_ES5",
      "addOns": {
        "common": {
          "name": "Cats",
          "logoUrl": "https://www.gstatic.com/images/icons/material/system/1x/pets_black_48dp.png",
          "useLocaleFromApp": true,
          "homepageTrigger": {
            "runFunction": "onHomepage",
            "enabled": true
          },
          "universalActions": [{
            "label": "Learn more about Cataas",
            "openLink": "https://cataas.com"
          }]
        },
        "gmail": {
          "contextualTriggers": [{
            "unconditional": {
            },
            "onTriggerFunction": "onGmailMessage"
          }],
          "composeTrigger": {
            "selectActions": [{
              "text": "Insert cat",
              "runFunction": "onGmailCompose"
            }],
            "draftAccess": "NONE"
          }
        },
        "drive": {
          "onItemsSelectedTrigger": {
            "runFunction": "onDriveItemsSelected"
          }
        },
        "calendar": {
          "eventOpenTrigger": {
            "runFunction": "onCalendarEventOpen"
          }
        }
      }
    }
    
    

    Where oauthScopes will request permissions for each application, addOns.common will define the common parameters for all of the services defined below, like addOns.drive. In the Drive service you will see the onItemsSelectedTrigger which will handle the event of selecting an item and it will run the onDriveItemsSelected function previously defined in the Quickstart example. You can see all the event triggers related here.

    Once you installed your add-on it will be shown in the UI of each service defined in your manifest. Keep in mind this is just a self installation tutorial, you should follow this tutorial in order to publish your add-on so another one is able to install it.