Android 13 Push Notification Developer Update Guide

This guide ensures your app is ready for Android 13's new Notification Permission requirements.

Android Push Subscription Changes

The release of Android 13 comes with many push subscription changes. Users will now be asked to opt-in to receive push notifications, instead of opting in by default and having to opt out. With the following guidance, iZooto will enable you to prompt Android mobile app users to subscribe to push the right way.

To prepare and update your app for the Android 13 permission prompt process, you will need to:

  • Update to the latest version of the iZooto SDK for your platform (v 1.5.9+).
  • Add notification permission prompting to support any new installs on Android 13+.

If no action is taken, Android 13 users who install your app will be immediately prompted for notification permission the first time they open your app. This is not the best user experience so this developer guide walks you through the changes you need to make to prompt later, at a more ideal time.

Push Permission Behaviours

Android 13 requires prompting users for permission to show push notifications. This change applies to ALL newly installed apps on Android 13. Generally, there are 3 states for push permissions: Allow, Don't Allow, and Ignored. Here is how it will work:

Allow

  • If a user has already granted permission on an older Android OS (12-), they will not be prompted again.
  • If a user installs the app on an Android 13 device, notifications are in the "don't allow" state by default. The user must grant permission before any notifications will be sent to them.
  • If your app targets Android 13, you can control when the push permission prompt is sent. This is why it is important to ensure your app is updated. If you can time the prompt and explain the value of notifications, users will more likely accept the prompt.
  • If your app targets Android 12 or lower, the push permission prompt will likely show when the user updates to Android 13 and open the app.

Don't Allow

  • If you have updated your app to Android 13 and the user selects "don't allow", then your app cannot send them push notifications.
  • If you have not updated your app to Android 13, and the user has selected "don't allow" previously, they will not be asked for push permission again until either the user uninstalls and reinstalls your app, or your app is updated to target Android 13.

Ignored

If the user swipes the dialog away, choosing neither "allow" nor "don't allow", the notification permission state does not change.

Effects on Newly-Installed Apps

If a user installs your app on a device that runs Android 13 or higher, 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 targetSdkVersion:

  • 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 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 minimise disruptions associated with the notification permission, the system automatically pre-grants permission to all apps, that have an existing notification channel and do not have its notifications explicitly disabled by the user on a device that runs 12L or lower, when the user upgrades their device to Android 13 or higher. In other words, these apps can continue to send notifications o users and users do not see a runtime permission prompt.

Updating your App for Android 13

Step 1. Update your iZooto SDK

Android Native: iZooto Android SDK 1.5.9+

  • app/build.gradle: implementation 'com.izooto:android-sdk:1.5.9'

Flutter: iZooto Flutter plugin version 2.1.4+
React Native: iZooto React Native plugin version 2.1.4+

Step 2. Update Project Settings to target Android 13

Validate that your app is configured to target Android API level 33 or newer, and follow one of the sections below for the type of project you have.

Android Native

Validate your compile and target SDK version is at least version 33.

android {
    compileSdkVersion 33
    
    defaultConfig {
        targetSdkVersion 33
    }
}

See Google's Set up the Android 13 SDK for more details if you have a different project configuration.

Flutter

Validate your compile and target SDK version is at least version 33.

android {
    compileSdkVersion 33
    
    defaultConfig {
        targetSdkVersion 33
    }
}

React Native

Validate your compile and target SDK version is at least version 33.

android {
    compileSdkVersion 33
    
    defaultConfig {
        targetSdkVersion 33
    }
}

Step 3. Add Notification Permission Prompt

Use the below iZooto method to trigger the native Permission Prompt.

Show the Android native notification permission prompt from your own UI or logic.

iZooto.promptForPushNotifications();
iZooto.promptForPushNotifications()
iZooto.promptForPushNotifications();
iZooto.promptForPushNotifications()