درباره اعلان ها و مکالمات
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
اعلانها بهروزرسانیهای به موقع و مرتبط را از برنامه شما به کاربر ارائه میدهند که در مکانهایی مانند نوار وضعیت، کشوی اعلانها و صفحه قفل ظاهر میشوند. آنها کاربران را در مورد پیامها، بهروزرسانیها یا رویدادهای مرتبط در برنامه شما مطلع میکنند - بهویژه زمانی که برنامه شما در پیشزمینه اجرا نمیشود.
مکالمات اعلانهایی برای پیامرسانی همزمان با افرادی هستند که یک بخش اولویتبندی شده اختصاصی در کشوی اعلان دریافت میکنند. مکالمات از حباب ها پشتیبانی می کنند و اهداف را به اشتراک می گذارند . آنها باعث میشوند برنامه پیامرسانی شما به خوبی با تجربه Android یکپارچه شده، تعامل کاربر را افزایش دهد و برنامه شما را در ذهن نگه دارد.
مفاهیم کلیدی اعلان اندروید را بشناسید
استفاده موثر و صحیح از اعلان ها به برنامه شما راهی عالی برای جذب مجدد کاربران می دهد، اما چیزهای زیادی برای دانستن وجود دارد. در اینجا برخی از اصول اولیه وجود دارد:
- مجوز زمان اجرا اعلان ( POST_NOTIFICATIONS ): از Android 13 (سطح API 33) به بعد، برنامهها باید مجوز POST_NOTIFICATIONS را برای ارسال اعلانها درخواست کنند، و به کاربران اجازه میدهد کنترل مستقیمی بر روی برنامههایی که میتوانند برای آنها اعلان ارسال کنند.
- کانالهای اعلان : برنامهها باید از کانالها برای ارسال اعلانها استفاده کنند، و کانالها دارای شناسههای منحصربهفرد و نامهای قابل مشاهده برای کاربر هستند. کاربران میتوانند تنظیمات اعلانها را در هر کانال بهطور دقیق تنظیم کنند، بنابراین باید اعلانهای خود را بر اساس نوع یا اولویت به روشهایی که کاربران قابل درک باشند (مانند پیامها، هشدارها، بهروزرسانیها) دستهبندی کنید.
- گروههای اعلان : گروهها اعلانهای مرتبط را بهصورت بصری سازماندهی میکنند و به کاربران اجازه میدهند تا آنها را بهعنوان یک واحد مدیریت کنند.
- نشان اعلان : این نقطه یا عدد کوچک روی نماد برنامه (بسته به پشتیبانی راهانداز) اعلانهای خوانده نشده را نشان میدهد. (شما می توانید انتخاب کنید که برنامه شما یک شماره سفارشی ارائه دهد).
- MessagingStyle : یک سبک اعلان که برای نمایش مکالمات بین افراد یا گروههای مختلف افراد استفاده میشود. برای استفاده از ویژگیهای مکالمه Android، اعلانهای شما باید با این سبک ایجاد شوند.
- اقدامات اعلان : دکمههایی در پایین یک اعلان که عملکردی را روی دادههایی که اعلان نشان میدهد انجام میدهد، مانند «بایگانی» یا «پاسخ». اعلانها حتی میتوانند به کاربران اجازه دهند مستقیماً پاسخها را تایپ کنند.
برای آشنایی با اصول اولیه اعلانهای Android به نمای کلی اعلانها مراجعه کنید. برای مروری دقیق تر از آوردن برنامه پیام رسانی خود به بالاترین سطوح Android، بهترین شیوه ها برای برنامه های پیام رسانی را ببینید. برای کسب اطلاعات بیشتر درباره بهترین شیوهها و ابزارهای اساسی اعلانها و مکالمات ، افراد و مکالمات را ببینید.
برنامه خود را ارتقا دهید
برای کمک به برنامه پیامرسانی خود برای برآورده کردن و فراتر رفتن از انتظارات کاربر و ایجاد حس یکپارچگی کامل برنامه با Android، میخواهید از ویژگیهای اعلانهایی که Android ارائه میکند نهایت استفاده را ببرید:
راهنمای کامل دارای ویژگیهای مرتبط با اعلانهای بیشتری است که باید در نظر بگیرید تا تجربه پیامرسانی و اجتماعی شما را به سطح بعدی ارتقا دهید.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2024-10-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2024-10-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# About notifications and conversations\n\n[Notifications](/develop/ui/views/notifications) provide timely, relevant updates from your app to the user\nthat appear in places such as the status bar, notification drawer, and the lock\nscreen. They inform users about relevant messages, updates, or events within\nyour app --- particularly while your app isn't running in the foreground.\n\n[Conversations](/develop/ui/views/notifications/conversations) are notifications for real-time messaging with people that\nget a dedicated prioritized section in the notification drawer. Conversations\nsupport [bubbles](/develop/ui/views/notifications/bubbles) and [share targets](/training/sharing/direct-share-targets). They make your messaging app feel\nwell-integrated into the Android experience, enhance user engagement, and keep\nyour app top of mind.\n\n### Know key Android notification concepts\n\nUsing notifications effectively and correctly gives your app a great way to\nre-engage your users, but there is a lot to know. Here are some of the basics:\n\n- [**Notification Runtime Permission**](/develop/ui/views/notifications/notification-permission) (**POST_NOTIFICATIONS** ): Starting in Android 13 (API level 33) and later, apps must request the [POST_NOTIFICATIONS](/reference/android/Manifest.permission#POST_NOTIFICATIONS) permission to send notifications, giving users direct control over which apps can send them notifications.\n- [**Notification Channels**](/develop/ui/views/notifications/channels): Apps are required to use channels to post notifications, and channels have unique IDs and user-visible names. Users can fine-tune notification settings per channel, so you should categorize your notifications by type or priority in ways that users can understand (e.g., messages, alerts, updates).\n- [**Notification Groups**](/develop/ui/views/notifications/group): Groups visually organize related notifications, and allow users to manage them as a unit.\n- [**Notification Badge**](/develop/ui/views/notifications/badges): This small dot or number on an app's icon (depending on launcher support) indicates unread notifications. (You can choose to have your app provide a custom number instead).\n- [**MessagingStyle**](/reference/android/app/Notification.MessagingStyle): A notification style that is used to represent conversations between different people or groups of people. Your notifications must be created with this style to use Android's [conversation features](/develop/ui/views/notifications/conversations).\n- [**Notification Actions**](/develop/ui/views/notifications#Actions): Buttons at the bottom of a notification that perform an action on the data the notification represents, such as \"Archive\" or \"Reply.\" Notifications can even allow users to directly type replies.\n\nSee [Notifications overview](/develop/ui/views/notifications) to learn about the basics of Android\nNotifications.\nSee [Best practices for messaging apps](/develop/ui/views/notifications/build-notification#messaging-best-practices) for a more detailed overview of\nbringing your messaging app to the most Android surfaces.\nSee [People and conversations](/develop/ui/views/notifications/conversations) to learn more about notifications and\nconversations best practices and fundamental tools.\n\n### Level up your app\n\nTo help your messaging app meet and surpass user expectations and make your\napp feel fully integrated with Android, you'll want to take full advantage\nof the notification features Android has to offer:\n\n- Support [conversation notifications](/develop/ui/views/notifications/conversations#api-notifications) with [long-lived shortcuts](/develop/ui/views/notifications/conversations#api-shortcuts) so users can add people and group shortcuts to their homescreens via widgets.\n- Support [notification badges](/develop/ui/views/notifications/badges) in the launcher.\n- Support [direct replies](/develop/ui/views/notifications/build-notification#direct-reply) so that users can respond to messages from within their notifications.\n- Enable [smart replies](/develop/ui/views/notifications/build-notification#smart-reply) for wearable devices to make it easier for users to communicate from their wrist.\n- Support [bubbles for conversations](/develop/ui/views/notifications/bubbles), so that people can keep conversations going easily while engaged with other tasks on their device.\n\nThe [full guide](/social-and-messaging/guides/communication/basic-better-best) has even more notification-related features to\nconsider to take your social and messaging experience to the next level."]]