Android 13 (Tiramisu)’s new APIs and features are ready to be tried out by developers. With the release of Android 13, there have been seve...

Android 13 - Runtime Notification Permission Android 13 - Runtime Notification Permission

Android 13 - Runtime Notification Permission

Android 13 - Runtime Notification Permission

Android 13 (Tiramisu)’s new APIs and features are ready to be tried out by developers. With the release of Android 13, there have been several changes to push notification permissions. This is a critical update that all Android developers should be aware of and understand. In this article, we'll discuss the new push notification permissions in Android 33 and provide a sample code in Xamarin for implementation.

Why the Change in Push Notification Permission in Android 13?

The change in push notification permission in Android 13 is aimed at providing users with more control over their privacy and security. In the past, push notifications were automatically granted when an app was installed. This resulted in many users receiving unwanted notifications from apps that they never intended to use. With the new push notification permission, users can now choose to allow or deny push notifications from individual apps.


How the Push Notification Permission Works in Android 13

In Android 33, push notification permission is prompted when the user opens an app for the first time. The user will be asked if they want to allow or deny push notifications from the app. If the user chooses to allow notifications, they will receive push notifications from the app. If the user denies notifications, they will not receive any push notifications from the app.


What Does this Mean for Users?

For users, the new push notification permissions system means that they have more control over the data that apps can access. This is a positive step forward in terms of privacy and security, as it gives users more control over the information that is shared with app developers. It also means that users can choose to turn off push notifications for apps that they no longer use or no longer find relevant.


Pre-Requisites:

  • Visual Studio 2022 - We cannot use the Visual Studio 2019, since Android 13 was only available in the release VS2022 and will not be available with VS2019 even we use the same SDK for both the IDEs.
  • Target Framework should be Android 13
  • Target SDK version should be Android 13

Sample Code:

Once the above are completed, then we need to include POST_NOTIFICATIONS permission in android manifest file


Add the following code in the Xamarin Main Activity --> OnStart Method


To know more about the "Android 13 - Runtime Notification Permission", visit the official Android developer link by clicking the below button.


0 comments:

Please Comment about the Posts and Blog