Skip to main content

For Android 9 or above use this:

adb shell cmd notification allow_listener com.mypackage.app/com.mypackage.app.mylistener

in android 9 and above

For any other Android version below 9, use this:

adb shell settings put secure enabled_notification_listeners %nlisteners: com.example.myapplication/com.example.myapplication.service.ServiceNotificationIntercept

use

adb shell cmd notification allow_listener com.mypackage.app/com.mypackage.app.mylistener

in android 9 and above

For below 9,

adb shell settings put secure enabled_notification_listeners %nlisteners: com.example.myapplication/com.example.myapplication.service.ServiceNotificationIntercept

For Android 9 or above use this:

adb shell cmd notification allow_listener com.mypackage.app/com.mypackage.app.mylistener

For any other Android version below 9 use this:

adb shell settings put secure enabled_notification_listeners %nlisteners: com.example.myapplication/com.example.myapplication.service.ServiceNotificationIntercept
Source Link

use

adb shell cmd notification allow_listener com.mypackage.app/com.mypackage.app.mylistener

in android 9 and above

For below 9,

adb shell settings put secure enabled_notification_listeners %nlisteners: com.example.myapplication/com.example.myapplication.service.ServiceNotificationIntercept