Class Notification

Thông báo

Một thông báo xuất hiện cho người dùng để phản hồi hoạt động tương tác với một phần tử trên giao diện người dùng.

const 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();
}

Phương thức

Phương thứcKiểu dữ liệu trả vềMô tả ngắn
setText(text)NotificationĐặt văn bản cần hiển thị trong thông báo.

Tài liệu chi tiết

setText(text)

Đặt văn bản cần hiển thị trong thông báo. Bắt buộc.

Tham số

TênLoạiMô tả
textStringNội dung thông báo.

Cầu thủ trả bóng

Notification – Đối tượng này, để liên kết.