Android 13 introduces a new
runtime permission for sending
non-exempt notifications from an app:
This change helps users focus on the notifications that are most important to
We highly recommend that you target Android 13 as soon as possible to benefit from the additional control and flexibility of this feature. If you continue to target 12L (API level 32) or lower, you lose the opportunity to request the permission in the context of your app's functionality.
Use the new permission
To request the new notification permission from your app, update your app to target Android 13 and complete a similar process compared to requesting other runtime permissions, as shown in the following sections.
The permission that you need to declare in your app's manifest file appears in the following code snippet:
<manifest ...> <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <application ...> ... </application> </manifest>
App capabilities depend on user choice in permissions dialog
In this dialog, users have the following actions available to them:
Caution: If your app targets 12L (or lower) and the user taps Don't allow, even just once, they aren't prompted again until one of the following occurs:
- The user uninstalls and reinstalls your app.
- You update your app to target Android 13.
The following sections describe how your app behaves, based on which action the user takes.
User selects "Allow"
If the user selects the allow option, your app can do the following:
- Send notifications. All notification channels are allowed.
- Post notifications related to foreground services. These notifications appear in the notification drawer.
User selects "Don't allow"
If the user selects the don't allow option, your app can't send notifications. All notification channels are blocked, except for a few specific roles. This is similar to the behavior that occurs when the user manually turns off all notifications for your app in system settings.
User swipes away from dialog
If the user swipes away from the dialog—that is, they don't select either allow or don't allow—the following behavior occurs:
- If your app is eligible for a temporary notification permission grant, the system preserves the temporary grant.
- If your app doesn't have a temporary grant, your app can't send notifications.
Effects on newly-installed apps
If a user installs your app on a device that runs Android 13, your app's notifications are off by default. Your app must wait to send notifications until after you request the new permission and the user grants that permission to your app.
The time at which the permissions dialog appears is based on your app's target SDK version:
- If your app targets Android 13 or higher, your app has complete control over when the permission dialog is displayed. Use this opportunity to explain to users why the app needs this permission, encouraging them to grant it.
- If your app targets 12L (API level 32) or lower, the system shows the permission dialog the first time your app starts an activity after you create a notification channel, or when your app starts an activity and then creates its first notification channel. This is usually on app startup.
Effects on updates to existing apps
To minimize disruptions associated with the new notification permission, some devices automatically pre-grant the new notification permission. On all other devices, the system automatically grants the new notification permission temporarily to all eligible apps that are already installed on the user's device prior to the system upgrade to Android 13. The length of this temporary grant depends on your app's target SDK version:
If your app targets Android 13 or higher, the temporary grant usually lasts until the first time the user initiates an activity launch for your app.
Your app has complete control over when the permission dialog is displayed. Use this opportunity to explain to users why the app needs this permission, encouraging them to grant it.
If your app targets 12L or lower, the temporary grant lasts until the user explicitly selects an option in the notification permission runtime dialog. This means that if the user dismisses the permission prompt without making a selection, the system persists the temporary grant for your app.
Eligibility for temporary permission grant
For your app to be eligible for a temporary grant, it must have an existing notification channel and not have its notifications explicitly disabled by the user on a device that runs 12L or lower.
If the user disabled notifications for your app on a device that runs 12L or lower, that denial persists when the device upgrades to Android 13 or higher.
Notifications related to media sessions are exempt from this behavior change.
This section describes several ways that you can use the new notification permission most effectively in your app.
Update your app's target SDK version
To give your app more flexibility over when the permission dialog appears, update your app so that it targets Android 13.
Wait to show notification permission prompt
Before you ask users to grant any permissions, let them familiarize themselves with your app.
New users may want to explore the app and realize first-hand the benefits of each individual notification request. You can trigger a permissions prompt from a user action. The following list shows several examples of when it's a good time to show the notification permission prompt:
- The user taps an "alert bell" button.
- The user chooses to follow someone's social media account.
- The user submits an order for food delivery.
Figure 1 shows a recommended workflow for requesting the notification
true, your app doesn't need to display the middle screen—the one that
has the title text "Get notified!".
Alternatively, you can set a request to appear after you give users a chance to familiarize themselves with your app. For example, you might wait until the third or fourth time the user launches your app.
Request the permission in context
When you request notification permissions within your app, do so in the correct context, so that it's explicitly clear what the notifications are used for and why the user should opt in. For example, an email app might include options to send notifications for every new email, or only the emails where the user is the only recipient.
Use this opportunity to give transparency to your intentions, and users are more likely to grant the notification permission to your app.
Check whether your app can send notifications
Before your app sends a notification, confirm whether the user has enabled
notifications for your app. To do so, call
Use the permission responsibly
After you receive approval to send notifications, remember to use the permission responsibly. Users can see the number of daily notifications that your app sends, and they can revoke the permission at any time.