Class Notification
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Уведомление Уведомление, отображаемое пользователю как ответ на взаимодействие с элементом пользовательского интерфейса.
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();
}
Подробная документация
set Text(text)
Устанавливает текст, отображаемый в уведомлении. Необходимый.
Параметры
Имя | Тип | Описание |
---|
text | String | Текст уведомления. |
Возвращаться
Notification
— этот объект для цепочки.
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-24 UTC.
[null,null,["Последнее обновление: 2025-07-24 UTC."],[],["The core content details how to create and display a notification to a user interacting with a UI element. A new `Action` is created, and a `TextButton` is linked to it using `setOnClickAction`. The `notificationCallback` function, triggered by the button, builds an `ActionResponse` with a `Notification`. `setText()` method is used to set the notification message text. It takes a string and returns the `Notification` object, permitting method chaining.\n"],null,[]]