Class Notification

通知

向使用者顯示的通知,做為與 UI 元素互動的回應。

var action = CardService.newAction().setFunctionName("notificationCallback");
CardService.newTextButton().setText('Save').setOnClickAction(action);

// ...

function notificationCallback() {
  return CardService.newActionResponseBuilder()
      .setNotification(CardService.newNotification()
          .setText("Some info to display to user"))
      .build();
}

方法

方法傳回類型簡短說明
setText(text)Notification設定要在通知中顯示的文字。

內容詳盡的說明文件

setText(text)

設定要在通知中顯示的文字。這是必填欄位。

參數

名稱類型說明
textString通知文字。

回攻員

Notification — 此物件用於鏈結。