英文:
Cannot test onInstall on test deployment in google sheet scripts
问题
My onOpen
函数用于在Google表格脚本中显示自定义菜单,它运行得很好,而且我还简单地创建了onInstall
函数如下:
function onInstall(e){
onOpen(e)
}
onOpen
在所有授权类型下都运行正常,但当我尝试发布插件时,Google会给出以下错误:
菜单 - 安装应用后未显示菜单选项。请确保插件正确使用
onInstall()
和onOpen()
来填充其菜单。菜单项在首次安装插件和打开不同文件时填充。请参阅编辑器插件授权。
因此,我不明白这个问题,如果有人知道如何模拟onInstall
,请告诉我。
我尝试运行测试部署,但无法模拟onInstall
。
英文:
My onOpen
for showing custom menu in google sheet scripts is working perfectly and I have also done onInstall
simply like this
function onInstall(e){
onOpen(e)
}
onOpen is running under all oath types but then google give this error when I try to publish addon
> 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.
So I don't understand this problem also if anyone know how to mock onInstall please let me know.
I tried running test deployment but cannot mock onInstall in it.
答案1
得分: 0
找到解决方案,正如Daniel所提到的。
首先私下部署和测试扩展,然后当扩展公开部署时,它应该正常工作。否则,我们无法测试 onInstall。
英文:
Found the solution as Daniel mentioned.
First private deploy and test the extention then it should work when extention will be deployed publically. Otherwise we can't test onInstall.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论