向使用者顯示的通知做為與 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 | 設定要顯示在通知中的文字。 |