react-native-push-notification: [Android 13] Missing notifications permission

Bug

Since Android API 33 developers are obliged to manually request permissions for push notifications

This library is not doing that for Android, so push notifications do not work on Android 13.

Would be nice to have that permissions request added when we use requestPermissions: true

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 18

Most upvoted comments

Good afternoon everyone, today the same thing happened to me with my application and the solution for me was the following:

  1. Update the version of react-native-push-notification to the latest version (8.1.1).
  2. Add in your manifest the following two permissions:

<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />

  1. By default notification permissions in android 13 are disabled so your notification will not be displayed. To solve this problem you can execute the following two solutions:

3.1. The first and quickest solution to see if your app works is to enable notification permissions manually. To do this go to settings>notifications>app settings>all apps and activate notifications in your app.

3.2. The second solution is to use a package like react-native-permissions(3.6.1) and evaluate the notifications permission (request(PERMISSIONS.ANDROID.POST_NOTIFICATIONS)) so that it is displayed on the screen and the user can give the permissions .

I hope the answer can be of help to those who are having this problem. Greetings

Bruh… I just had DND on… I debugged for 3 hours…

@tdammy92 add these two line in AndroidManifest.xml

<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />

@komailabbas12 I did, even requsted Notification permission. did not work…