Android Question API 33 and Notification permission

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
@Pendrush posted this question about The new API 33 notification permission


At the time I didn't have a phone which was on Android 13, but I now do.

I thought I would try to add the permission string to see what happens


I created a little program which can call Check or CheckandRequest

I have added AddPermission(android.permission.POST_NOTIFICATIONS) in the manifest

with Manifest android:targetSdkVersion="33"

Results:
(Google Pixel 2xl) Android Version 30 - check = false, checkandrequest = false (dialog does not appear)

(Google Pixel 5 running CalyxOS) Android version 33 - Check = false, checkandrequest (dialog appears)


However if I set the Manifest android:targetSdkVersion to "31"

Results:
(Google Pixel 2xl) Android Version 30 - check = false, checkandrequest = false (dialog does not appear)

(Google Pixel 5 running CalyxOS) Android version 33 - Check = no result, checkandrequest (dialog does NOT appear)

Conclusion:

I will need to release new versions of any app which has notifications to ensure that the user can choose to accept Notifications/

the code will need to check for API 33 and only checkandRequest if this is the case.

I'd be interested to know the thoughts of other developers
 

Attachments

  • chkpermission.zip
    14.6 KB · Views: 164

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
But that would mean that Notifications will not work on Android 13 phones for newly installed apps.
I did find that if the app was installed before update to Android 13 then the notifications do work.

as @Pendrush says,
This is Android 13 behavior, no matter what is TargetSDK.
If you target any lower TargetSDK, by default no notification is shown on Android 13, not even notification for foreground services.
We need a way to show notification runtime permission on Android 13 somehow, as Android 13 is released over a month now:
 
Upvote 0
Top