zo0r / react-native-push-notification

React Native Local and Remote Notifications
MIT License
6.75k stars 2.05k forks source link

Missing permissions required by intent Intent.ACTION_CLOSE_SYSTEM_DIALOGS: #2158

Open senolatac opened 2 years ago

senolatac commented 2 years ago

version: 8.1.0

When: When I call the ./gradlew build command.

I got an error like:

react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationActions.java:75: Error: Missing permissions required by intent Intent.ACTION_CLOSE_SYSTEM_DIALOGS: android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS [MissingPermission]
              context.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
AliuDardan commented 2 years ago

Hello @senolatac I had the same issues with this error and I solved by changing this file in node_modules:

react-native-push-notification/android/build.gradle Specifically change the following params:

compileSdkVersion safeExtGet('compileSdkVersion', 31) buildToolsVersion safeExtGet('buildToolsVersion', '30.0.3') defaultConfig { minSdkVersion safeExtGet('minSdkVersion', 25) targetSdkVersion safeExtGet('targetSdkVersion', 30) versionCode 1 versionName "1.0" ndk { abiFilters "armeabi-v7a", "x86" } }

senolatac commented 2 years ago

Thank you @AliuDardan, but it didn't work for me.

ThomasStubbe commented 2 years ago

I'm having the same issue... Adding <uses-permission android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS"/> to the AndroidManifest does not solve the problem... Also I do wish to target down to API level 21

rameezh88 commented 2 years ago

Any update on this? I am facing the same problem.

falihnaufal17 commented 2 years ago

Hi guys any update on this issue?? I have same problem.

jeremyfrancis commented 2 years ago

Same issue here, any ideas?

darylescode commented 1 year ago

Hello guys, What is the alternative way to avoid it in the meantime?

asadaltaf583 commented 1 year ago

Any update? i am developing a screen recorder application with a toolbar buttons like screen recorder home screenshot button when i click on any button i want to lose notification drawer first .Help me

Vashu473 commented 1 year ago

If Anyone got the solution , please tag me

asadaltaf583 commented 1 year ago

Waiting for solution

bardolf69 commented 11 months ago

anyone ever find a way to fix this?

asadaltaf583 commented 11 months ago

Yes i resolve it for my screen recorder application.

mansimakwana25 commented 10 months ago

Hi @asadaltaf583, can you tell me how you have resolved it..?

hekuranc commented 10 months ago

Yes i resolve it for my screen recorder application.

why do you bother responding if you don't share your work around?

asadaltaf583 commented 10 months ago

I resolved it by starting a new activity with a PendingIntent.

sampriti026 commented 3 months ago

@asadaltaf583 how did you do it, can you please send a workaround

asadaltaf583 commented 3 months ago

With pending intent move to an activity to close notification tray

Message ID: <zo0r/react-native-push-notification/issues/2158/2135665007@ github.com>