0

我已经开始收到报告说我们使用了一段时间的插件停止在 iOS 移动设备上运行。我能够确认这一点并开始深入研究这些问题。我已经能够使用多个 Google 帐户(gmail 和工作区)通过“快速入门:Cats Google Workspace Add-on”重现该错误。从卡片中的按钮调用的函数返回的卡片、导航和通知似乎不会在 iOS Gmail 上呈现。该代码似乎可以在桌面上运行。我可以使用快速入门教程对此进行演示。我使用以下显示当前时间而不是猫图片的 createCatCard 消除了移动设备上对白名单 url 的需求。该项目适用于桌面,但不适用于 iOS Gmail。

我已经通过他们的问题跟踪器(https://issuetracker.google.com/issues/210484310)向谷歌报告了这一点,但他们声明“问题跟踪器旨在报告问题并要求与谷歌/在谷歌上的开发相关的功能产品,因此它不是在这个问题上寻求支持的最佳场所。”

有谁知道是否仍然支持 iOS Gmail 插件以及是否有解决此问题的方法?

/**
 * Creates a card with an image of a cat, overlayed with the text.
 * @param {String} text The text to overlay on the image.
 * @param {Boolean} isHomepage True if the card created here is a homepage;
 *      false otherwise. Defaults to false.
 * @return {CardService.Card} The assembled card.
 */
function createCatCard(text, isHomepage) {
  // Explicitly set the value of isHomepage as false if null or undefined.
  if (!isHomepage) {
    isHomepage = false;
  }

  // Use the "Cat as a service" API to get the cat image. Add a "time" URL
  // parameter to act as a cache buster.
  var now = new Date();
  // Replace formward slashes in the text, as they break the CataaS API.
  var caption = text.replace(/\//g, ' ');
  var d = new Date();
  var textLabel = CardService.newTextParagraph().setText("Current Time." + d.toLocaleTimeString());

  // Create a button that changes the cat image when pressed.
  // Note: Action parameter keys and values must be strings.
  var action = CardService.newAction()
      .setFunctionName('onChangeCat')
      .setParameters({text: text, isHomepage: isHomepage.toString()});
  var button = CardService.newTextButton()
      .setText('Change cat')
      .setOnClickAction(action)
      .setTextButtonStyle(CardService.TextButtonStyle.FILLED);
  var buttonSet = CardService.newButtonSet()
      .addButton(button);


  // Assemble the widgets and return the card.
  var section = CardService.newCardSection()
      .addWidget(textLabel)
      .addWidget(buttonSet);
  var card = CardService.newCardBuilder()
      .addSection(section);

  if (!isHomepage) {
    // Create the header shown when the card is minimized,
    // but only when this card is a contextual card. Peek headers
    // are never used by non-contexual cards like homepages.
    var peekHeader = CardService.newCardHeader()
      .setTitle('Contextual Cat')
      .setImageUrl('https://www.gstatic.com/images/icons/material/system/1x/pets_black_48dp.png')
      .setSubtitle(text);
    card.setPeekCardHeader(peekHeader)
  }

  return card.build();
}
4

0 回答 0