简体   繁体   English

通过 G-Suite Marketplace SDK 发布时不会创建附加菜单,但会通过 Chrome 网上应用店创建

[英]Add-on menu doesn't get created when published through G-Suite Marketplace SDK, but does through Chrome Web Store

Whether by using createAddonMenu() or createMenu(), I can't create menu when add-on is installed through GSM, or when opened with "Integrate With Google" via G-Suite Marketplace SDK.无论是使用 createAddonMenu() 还是 createMenu(),当通过 GSM 安装附加组件时,或者通过 G-Suite Marketplace SDK 使用“与 Google 集成”打开时,我都无法创建菜单。 "Test as add-on" via Script Editor works, installation via Chrome Web Store works, and I have no idea what might be wrong.通过脚本编辑器“作为插件进行测试”工作,通过 Chrome 网上应用店安装工作,我不知道可能有什么问题。 I'm not sure if the script runs in the first place.我不确定脚本是否首先运行。

I've tried existing solutions from StackOverflow such as calling functions in different order, but nothing seems to work.我已经尝试过 StackOverflow 中的现有解决方案,例如以不同的顺序调用函数,但似乎没有任何效果。

Does someone know what might prevent add-on/script from working with GSM?有人知道什么可能会阻止附加组件/脚本与 GSM 一起使用吗?

Here's onOpen and onInstall functions I used.这是我使用的 onOpen 和 onInstall 函数。

function onOpen(e) {
  if(LOGENAB){console.log("onOpen...");}
  if(LOGENAB){console.log(e.authMode);}
  if(e && e.authMode == ScriptApp.AuthMode.NONE){
    // Authorization needed
    if(LOGENAB){console.log("# Authorization required!");}
    var ui = FormApp.getUi();
    var menu = ui.createMenu('title');
    menu.addItem('Authorize', 'authorizeAddon');
    menu.addToUi();
  } else {
    // Authorization not needed
    if(LOGENAB){console.log("# Authorization OK!");}
    var ui = FormApp.getUi();
    var menu = ui.createMenu('title');
   menu.addItem('Control Panel', 'showControlPanel');
   menu.addItem('About', 'showAbout');
   menu.addItem('Reset running status','toggleStatus');
   menu.addToUi();
  }
}
function onInstall(e) {
  if(LOGENAB){console.log("onInstall...");}
  onOpen(e);
}

Add-ons published as unlisted didn't show up in editor with older version of G-Suite services when installed through GSM.通过 GSM 安装时,以不公开形式发布的附加组件不会显示在带有旧版 G-Suite 服务的编辑器中。 This appears to be fixed in current version of the service.这似乎已在当前版本的服务中修复。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我在 G-Suite 市场上更新 GAS 插件时,它会自动更新吗? - Do GAS add-on update automatically when I update it on G-Suite marketplace? 我发布了一个 Google 表格插件,但它没有出现在 G Suite 市场列表中 - I published a Google Sheets add-on, but it's not appearing in the G Suite Marketplace list 带有附件的Google G-Suite表单上的自定义验证 - custom validation on Google G-Suite Form with an add-on 用户删除 G-Suite 插件时如何删除用户财产服务 - How to delete User Property Services when User deletes G-Suite Add-on 无法将Google编辑器附加组件发布到G Suite市场 - Unable to publish Google editor add-on to the G Suite Marketplace 如何将 Google Apps Script Web 应用程序发布到 G-Suite Marketplace? - How to publish a Google Apps Script web app to the G-Suite Marketplace? 如何防止在鼠标按下时更改 G-Suite 插件按钮的背景颜色 - How to prevent change background-color of button for G-Suite add-on on mousedown 错误消息“您必须配置 G Suite Marketplace SDK 才能发布插件。” 当 SDK 正确配置时 - Error message "You must configure the G Suite Marketplace SDK to publish an add-on." when SDK is correctly configured 在 G-Suite 插件中获取 CalendarEvent 的重复发生 - Get recurrence of CalendarEvent in G-Suite Addon 从Chrome商店安装插件后,Google表格和文档脚本无法创建插件菜单 - Google Sheets & Docs Script fails to create add-on menu when add-on is installed from Chrome store
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM