Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
354 views
in Technique[技术] by (71.8m points)

Google Workspace Add On HomepageTrigger fires in Google Sheets when changing tabs?

I am developing a Google Workspace Add On on Google Sheets. I've set the manifest file in appscript.json as below. Weirdly, homepageTrigger is fired when I change tab in a Google Sheet, so my card interface effectively reloads. I've tested this with the sample add-on code that Google provides here: https://developers.google.com/gsuite/add-ons/how-tos/navigation and am still seeing the issue. Below is the full appscript.json manifest code:

{
  "timeZone": "America/New_York",
  "dependencies": {
    "libraries": [
      {
        "userSymbol": "OAuth2",
        "libraryId": "1B7FSrk5Zi6L1rSxxTDgDEUsPzlukDsi4KGuTMorsTQHhGBzBkMun4iDF",
        "version": "40"
      }
    ],
    "enabledAdvancedServices": [
      {
        "userSymbol": "Sheets",
        "version": "v4",
        "serviceId": "sheets"
      }
    ]
  },
  "exceptionLogging": "STACKDRIVER",
  "oauthScopes": [
    "https://www.googleapis.com/auth/script.container.ui",
    "https://www.googleapis.com/auth/spreadsheets",
    "https://www.googleapis.com/auth/script.external_request"
  ],
  "runtimeVersion": "V8",
  "urlFetchWhitelist": ["https://api.getpickaxe.com/"],
  "addOns": {
    "common": {
      "name": "Pickaxe",
      "logoUrl": "https://i.ibb.co/HgnvcNx/Lead-Search-Icon-Active-1.png",
      "layoutProperties": {
        "primaryColor": "#7541EE",
        "secondaryColor": "#7541EE"
      }
    },
    "sheets": {
      "homepageTrigger": {
        "runFunction": "onHomepage"
      }
    }
  }
}

And here is the onHomepage function - simply calling the sample code referenced on this link:https://developers.google.com/gsuite/add-ons/how-tos/navigation

function onHomepage() {

  return createNavigationCard();

    };

Has anyone else seen this issue?

question from:https://stackoverflow.com/questions/65931733/google-workspace-add-on-homepagetrigger-fires-in-google-sheets-when-changing-tab

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...