Class Notification
알림
UI 요소와 상호작용한 것에 대한 응답으로 사용자에게 표시되는 알림입니다.
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();
}
자세한 문서
setText(text)
알림에 표시할 텍스트를 설정합니다. 필수 항목입니다.
매개변수
이름 | 유형 | 설명 |
text | String | 알림 텍스트입니다. |
리턴
Notification
: 연결을 위한 객체입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-12-21(UTC)
[null,null,["최종 업데이트: 2024-12-21(UTC)"],[[["Notifications inform users about the results of their interactions, such as clicking a button."],["Developers can use `setText()` to customize the notification's message."],["The notification is triggered by a function, which is set as an action on a UI element."],["`notificationCallback()` showcases how to build and display a notification to the user."]]],[]]