Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing permission android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS #2383

Open
TulioMeran opened this issue Sep 15, 2023 · 5 comments
Open

Comments

@TulioMeran
Copy link

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

@WhereareUmylove
Copy link

same

@ErnestPG
Copy link

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...

@vipulgupta27
Copy link

any update on this issue ?

@mabc21
Copy link

mabc21 commented Nov 28, 2023

I am also experiencing the same issue

@bond-it
Copy link

bond-it commented Dec 5, 2023

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));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants