Not allowed to change Do Not Disturb State

I am making an app that needs to set the ringer mode to silent, when i run the AudioComponent.Ringer Mode Silent block an error occurs:
“Not allowed to change Do Not Disturb State”, both in companion and in apk.

I granted all the required permissions but still doesn’t work.
I’ve also tried to grant Access to Do not disturb state from the phone’s settings but i haven’t found my app in the list.

Tested with two phones: Samsung J7 pro and Samsung S8+, both with android 9

1 Like

I need to update my app because for some user it isn’t working because of this “error”.
Can someone help me? I can’t find a solution

1 Like

Please provide your blocks images & Also post your app here… The details you provide are not sufficient to help …

1 Like

Example.aia (1,8 KB)

Here is an example file i’ve made, the errors are the same as in my original app.
When i ask for permission android.permission.ACCESS_NOTIFICATION_POLICY this error is shown in companion: Attempt to invoke virtual method 'void' on a null object reference

1 Like

You will need to give permission like @Taifun said here.

1 Like

As i already said…

@Kodular is it possible to add the apps to that menu?

Ask just for ACCESS_NOTIFICATION_POLICY! Delete the “android.permission”

this makes no difference

some users or all users?

Allmost all user with android version >= Android n

I say “almost” because not all the users sent me a bug report.

Already done, but the error occurs anyway

There is nothing written in the manifest file when you do this and thereof is not in the list

add it manually and it is in the list, but it does not work

If I remember correctly, I have never been able to make that component work


How can i add it manually to the list?

And how do taifun has been able to do that with his extension?

in an extension you can do more things as in the blocks
you might consider to buy the settings extension to get what you want…


1 Like

Sorry, forgot to write where and how, in the manifest file

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


1 Like

Maybe add a note to that block or disable it until you find a way to let it work

Maybe with AppyBuilder team you will be able to fix it (?)