Notification Action — interactive buttons and input fields that appear directly in a push notification and allow the user to perform an action without opening the app. This is a key element of user experience, shortening the path to the target screen. According to Android Developers, 2025, Notification Action increases user engagement by up to 40% by reducing friction in interaction.
Key Takeaways
Notification Action is an interactive interface element added to a push notification to perform a specific action. The user can reply to a message, confirm a task, or open a specific screen without entering the app. Actions appear as buttons below the notification text or in an expanded view upon swipe.
The main purpose of Notification Action is to reduce the number of steps for the user to reach their goal. Instead of opening the app and navigating to the desired screen, the user presses a single button. Research shows that apps with interactive notifications demonstrate 25–40% higher engagement compared to simple notifications.
On Android, Notification Actions are displayed as icon-buttons in compact view and text buttons in expandable mode. On iOS, actions appear upon long press on the notification or swipe left. Each platform has its own recommendations for the number of actions — Android recommends no more than 3, iOS no more than 4.
| Platform | Max Actions | Display Method | Action Types |
|---|---|---|---|
| Android | 3 | Icons + Text | Buttons, Text Input |
| iOS | 4 | Long Press / Swipe | Buttons, Text Input |
On Android, Notification Actions are created via NotificationCompat.Builder using the addAction() method. Each action contains an icon, text, and PendingIntent that fires when tapped. Starting from Android 7.0 (API 24), direct text input via RemoteInput is supported.
To create a button in a notification, you need to define a PendingIntent that will be launched when tapped. PendingIntent can open an Activity, start a Service, or a BroadcastReceiver. The action icon must be monochrome and conform to Material Design.
val acceptIntent = Intent(context, AcceptActionReceiver::class.java)
acceptIntent.putExtra("notification_id", notificationId)
val acceptPendingIntent = PendingIntent.getBroadcast(
context, requestCode,
acceptIntent, PendingIntent.FLAG_UPDATE_CURRENT
)
val notification = NotificationCompat.Builder(context, CHANNEL_ID)
.setSmallIcon(R.drawable.ic_notification)
.setContentTitle("Confirmation Request")
.setContentText("Confirm Task Completion")
.addAction(R.drawable.ic_accept, "Confirm", acceptPendingIntent)
.build()
For scenarios requiring text input (e.g., replying to a message), Android provides RemoteInput. The user enters text directly in the notification, and the app receives it without opening an Activity. RemoteInput is supported on Android 7.0+ and requires explicit handling in a BroadcastReceiver or Service.
val remoteInput = RemoteInput.Builder("reply_input")
.setLabel("Enter Reply")
.build()
val replyAction = NotificationCompat.Action.Builder(
R.drawable.ic_reply, "Reply", replyPendingIntent
)
.addRemoteInput(remoteInput)
.build()
val notification = NotificationCompat.Builder(context, CHANNEL_ID)
.addAction(replyAction)
.build()
When an action is tapped, the system launches the specified PendingIntent. To retrieve text entered via RemoteInput, call RemoteInput.getResultsFromIntent(intent). It is recommended to handle actions in IntentService or WorkManager to avoid blocking the UI thread.
On iOS, Notification Actions are implemented via the UserNotifications framework. The developer creates action categories (UNNotificationCategory) and registers them at app launch. Each action is defined by a UNNotificationAction object with a unique identifier.
To add actions to push notifications on iOS, you need to create a category that groups related actions. The category is specified in the notification payload via the category field. When a notification is received, the system displays available actions from the specified category.
import UserNotifications
class NotificationSetup {
func registerNotificationCategories() {
let approveAction = UNNotificationAction(
identifier: "APPROVE_ACTION",
title: "Approve",
options: [.foreground]
)
let declineAction = UNNotificationAction(
identifier: "DECLINE_ACTION",
title: "Decline",
options: [.destructive]
)
let category = UNNotificationCategory(
identifier: "REQUEST_CATEGORY",
actions: [approveAction, declineAction],
intentIdentifiers: [],
options: []
)
UNUserNotificationCenter.current()
.setNotificationCategories([category])
}
}
When the user taps an action, the system calls the userNotificationCenter:didReceiveNotificationResponse method in the UNUserNotificationCenter delegate. The response.actionIdentifier contains the identifier of the performed action. For text input, UNTextInputNotificationAction is used, which provides the text entered by the user.
extension AppDelegate: UNUserNotificationCenterDelegate {
func userNotificationCenter(
center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void
) {
switch response.actionIdentifier {
case "APPROVE_ACTION":
Log.d("Action: approved")
case "DECLINE_ACTION":
Log.d("Action: declined")
case UNNotificationDefaultActionIdentifier:
Log.d("Action: opened app")
default:
break
}
completionHandler()
}
}
Notification Action is classified by interaction type and usage scenario. The right choice of action type directly affects user experience and conversion to the target action.
The most common type — a button that opens the app on a specific screen. On Android, this uses PendingIntent.getActivity(), on iOS — the .foreground option of UNNotificationAction. Used for actions requiring a full interface, such as viewing order details.
Actions that execute without opening the app. On Android, PendingIntent.getBroadcast() or PendingIntent.getService() is used. On iOS — the .authenticationRequired option or without .foreground. Examples: marking a task as done, liking a post, adding to favorites.
Allows the user to enter text directly in the notification. On Android, implemented via RemoteInput, on iOS — via UNTextInputNotificationAction. Used for replying to messages, comments, entering one-time confirmation codes.
Actions that irreversibly change data — deletion, rejection, blocking. On Android, they are visually highlighted (red color in some systems), on iOS they require the .destructive option. It is recommended to request confirmation for destructive actions, for example via an additional dialog or a second tap.
A separate class of actions — entering text directly from the notification. On Android, this is implemented via RemoteInput in combination with PendingIntent. On iOS, UNTextInputNotificationAction is used, inheriting from UNNotificationAction. Such actions are used for quick replies in messengers, entering promo codes, filling out feedback forms, or rating service quality. The entered text is passed to the app along with the action identifier. For correct handling of text input on both platforms, it is necessary to implement parsing of the entered data and validation before executing the target action.
Correct Notification Action handling is critical for analytics and user experience. Each tap must be logged, and the action must be executed reliably even if the app was closed.
Track each Notification Action tap through your analytics system. Firebase Analytics, Mixpanel, or Yandex.Metrica allow you to record the action identifier, tap time, and notification context. This data helps optimize your notification strategy and increase engagement. A/B testing with different sets of actions helps identify the most effective user interaction scenarios.
If the app is closed, the system still delivers the Intent or UNNotificationResponse when an action is tapped. On Android, use a BroadcastReceiver for guaranteed handling. On iOS, the system launches the app in the background and passes the response to the delegate. For critical actions (payment confirmation, authorization), add a retry mechanism and notify the user of successful completion.
Starting from Android 7.0, developers can influence the appearance of Notification Action through icons and colors. Icons must be monochrome (alpha channel), 24x24 dp in size. On iOS, button customization is limited — system colors and fonts are used. Material Design recommends grouping actions by priority: the most important action first, destructive ones last.
Frequently Asked Questions
Android recommends no more than 3 actions, iOS — up to 4. Exceeding the limit causes some actions not to be displayed or to be hidden in a submenu.
The icon is passed in NotificationCompat.Action.Builder as a drawable resource. The icon must be monochrome (alpha channel), 24x24 dp in size, and comply with Material Design guidelines.
Yes, if the notification is displayed on the locked screen and the visibility flag is set to VISIBILITY_PUBLIC. On iOS, the .authenticationRequired option is required for actions that require authorization.
On Android, the system recreates the process and delivers the Intent. On iOS, the system launches the app in the background. Guaranteed delivery can be achieved using BroadcastReceiver on Android and UNNotificationServiceExtension on iOS.
On Android, actions are visible directly below the notification as icons. On iOS, actions are hidden behind a long press or swipe. UX design of notifications must account for these platform differences.
Summary
We will develop a mobile application turnkey
IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.
Read also