Home > Blockchain >  Cannot publish Editor addon on google workspace marketplace -Menu options not shown after App is ins
Cannot publish Editor addon on google workspace marketplace -Menu options not shown after App is ins

Time:04-21

I try to publish an Editor Add-on for Google Sheet into the workspace marketplace. But I'm struck on the review.
With this message :

The App doesn’t meet the publishing review criteria on the following: Menu - Menu options not shown after App is installed. Please ensure that the add-on correctly uses onInstall() and onOpen() to populate its menu. The menu items populate when the add-on is first installed and when a different file is opened. See Editor add-on authorization.

My app does not have a menu, so I was thinking I must add one, in my index function.
Failed with same message.
So I add an onOpen(e) and onInstall(e) functions like the documentations. And the review failed too.

So I don't know what to do.

My app is writed in AppScript

Here some code:

function menuItem1() {
  SpreadsheetApp.getUi() /
     .alert('You can contact me at ...');
}

function onInstall(e) {
  onOpen(e);
}
function onOpen(e) {
  SpreadsheetApp.getUi().createAddonMenu() 
      .addItem('Contact', 'menuItem1')
      .addToUi();
}


function index(isConnected = false) {
  var divider = CardService.newDivider();
 .....

And here my appscript.json

{
  "timeZone": "Europe/Paris",
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8",
  "oauthScopes": [
    "https://www.googleapis.com/auth/script.locale",
    "https://www.googleapis.com/auth/spreadsheets",
    "https://www.googleapis.com/auth/userinfo.email",
    "https://www.googleapis.com/auth/script.external_request"
  ],
  "urlFetchWhitelist": [
    "myapi"
  ],
  "addOns": {
    "common": {
      "homepageTrigger": {
        "runFunction": "index",
        "enabled": true
      },
      "logoUrl": "urltomylogo",
      "name": "Name of my app",
      "useLocaleFromApp": true
    },
    "sheets": {}
  }
}

My app has successfully passed the oAuth verificaton by Google. And now I'm stuck on the publishing

Help is appreciated,
Thx

CodePudding user response:

Since you are trying to publish an Editor Add on you should check the Authorization model that these type of Add ons need, not having a proper menu for your Add on will most likely be the main reason of it's rejection.

Checking the full lifecycle of these add ons should give you an idea of what you need to implement in your current state:

If an add-on is either installed for the current user or enabled in the current document, the add-on is loaded in the document, which causes it to appear in the Add-ons menu and start listening for the simple triggers onInstall(e), onOpen(e), and onEdit(e). If a user clicks one of the add-on’s menu items, it runs.

Reference:

CodePudding user response:

Apparently you have confussed Workspace Add-ons with Editors Add-ons or viceversa. Both might be created using Google Apps Script but the way to publish them is not the same.

An Editor Add-on can't use the CardService, this is only available for Workspace Add-ons, by the other hand Workspaces Add-ons can't use the onOpen simple trigger among other things.

Please review the details about the differences between Workspace Add-ons and Editors Add-ons on https://developers.google.com/apps-script/add-ons/concepts/types.

Resources

  • Related