Class Notification
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();
}
ज़्यादा जानकारी वाला दस्तावेज़
setText(text)
सूचना में दिखाने के लिए टेक्स्ट सेट करता है. ज़रूरी है.
पैरामीटर
नाम | टाइप | ब्यौरा |
text | String | सूचना का टेक्स्ट. |
वापसी का टिकट
Notification
— चेन करने के लिए यह ऑब्जेक्ट.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 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."]]],["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"]]