react-native-push-notification icon indicating copy to clipboard operation
react-native-push-notification copied to clipboard

Missing permission android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS

Open TulioMeran opened this issue 1 year ago • 7 comments

Bug

When i run ./gradlew build i'm getting this error:

image

React native version: 0.72.4 React-native-push-notification: 8.1.1

TulioMeran avatar Sep 15 '23 03:09 TulioMeran

same

WhereareUmylove avatar Sep 18 '23 02:09 WhereareUmylove

This is a permission available only for system apps. I don't understand why it's used.

The only way I found for compile is to avoid the compilation for the line referencing this permission.

Inside the source code of the module, navigate to -> src\main\java\com\dieam\reactnativepushnotifications\modules\RNPushNotificationActions.java

before ln 65, add this comment:

      //noinspection MissingPermission  <---add this comment
      context.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));

Hope this helps, at least for compiling, i have not tested yet what happens when I send a notification after this...

ErnestPG avatar Sep 18 '23 11:09 ErnestPG

any update on this issue ?

vipulgupta27 avatar Sep 26 '23 08:09 vipulgupta27

I am also experiencing the same issue

mabc21 avatar Nov 28 '23 11:11 mabc21

I found workaround. I commented line in file com.dieam.reactnativepushnotification.modules.RNPushNotificationActions: // context.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));

Maybe better approach is using this line only for android below 12:

if (android.os.Build.VERSION.SDK_INT <= Build.VERSION_CODES.S) {
       //noinspection MissingPermission
       context.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
}

bond-it avatar Dec 05 '23 01:12 bond-it

I found workaround. I commented line in file com.dieam.reactnativepushnotification.modules.RNPushNotificationActions: // context.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));

Maybe better approach is using this line only for android below 12:

if (android.os.Build.VERSION.SDK_INT <= Build.VERSION_CODES.S) {
       //noinspection MissingPermission
       context.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
}

Is there any better solution to fix this issue? i have the same problem with RN 0.74 and RNPN 8.1.1

mod-thr avatar Aug 21 '24 22:08 mod-thr