capacitor-plugins icon indicating copy to clipboard operation
capacitor-plugins copied to clipboard

Android 13 (API level 33) introduces a new runtime permission for notifications

Open bhandaribhumin opened this issue 2 years ago • 2 comments

Feature Request

Android 13 (API level 33) introduces a new runtime permission for sending non-exempt notifications from an app: POST_NOTIFICATIONS.

Plugin

Currently this plugin doesn't work when we set notifications because user don't see runtime permission popup on Android 13.

Preferred Solution

  • I have implemented this fix for Cordova in this repo cordova-plugin-local-notification-12

  • I have added few changes to get permission popup FIX

  • The permission that you need to declare in your app's manifest file appears in the following code snippet:

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

Additional Context

Screenshot 2022-08-08 at 7 09 50 PM

bhandaribhumin avatar Aug 08 '22 13:08 bhandaribhumin

@jcesarmobile any update?

bhandaribhumin avatar Aug 17 '22 07:08 bhandaribhumin

Local notifications are working fine on Android 13 devices as long as the app uses target SDK 32, which is the officially supported SDK of Capacitor 4. If you target SDK 32 and use notifications the app prompts for permission automatically on first app startup automatically.

If you target SDK 33 then you'll need to do the changes made on this PR https://github.com/ionic-team/capacitor-plugins/pull/1189

jcesarmobile avatar Aug 17 '22 09:08 jcesarmobile