CardService.newAuthorizationException()的问题

问题描述 投票:0回答:1

我有两个具有相同代码的Gmail加载项(DEV和PROD版本)。在我的代码中,我具有标准的accessProtectedResource函数(来自Add-ons documentation):

  function accessProtectedResource(url, data) {
  var service = getOAuthService();
  var maybeAuthorized = service.hasAccess();

  if (maybeAuthorized) {
    ...
  }

  if (!maybeAuthorized) {
    CardService.newAuthorizationException()
    .setAuthorizationUrl(service.getAuthorizationUrl())
    .setResourceDisplayName("Timelines")
    .throwException();
  }
}

问题是,如果用户未被授权-在PROD版本中,此功能将正确构建AuthorizationCard:

enter image description here

但是在DEV中,使用相同的代码,相同的功能导致加载项崩溃:enter image description hereenter image description here

有什么想法吗?

google-apps-script google-apps gmail-addons google-apps-script-addon
1个回答
0
投票

这是一个错误!

这是先前在Google Issue Tracker上报告的错误:


Class AuthorizationException issue on V8


您可以单击此页面左上角发行编号旁边的☆,因为它可以让Google知道更多人正在遇到此问题,因此更有可能看到更快的速度。

© www.soinside.com 2019 - 2024. All rights reserved.