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();
}
مستندات تفصيلية
setText(text)
تضبط هذه السمة النص الذي سيظهر في الإشعار. الحقل مطلوب.
المَعلمات
| الاسم | النوع | الوصف |
text | String | نص الإشعار |
الإرجاع
Notification: هذا العنصر، للتسلسل
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2026-04-13 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2026-04-13 (حسب التوقيت العالمي المتفَّق عليه)"],[],["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"]]