Skip to content Skip to sidebar Skip to footer

Checking If Notifications Are Enabled For Specific Package

I'm developing a system application and I need to check from my application if a certain package has notifications enabled or not. I've been triying this code: public static boolea

Solution 1:

If your method gets Context of the target application (which you want to check if notifications enabled).

You can create NotificationManagerCompat instance based on this Context and check if notifications are enabled for that application:

publicstaticbooleanisNotificationEnabled(Context context) {
    returnNotificationManagerCompat.from(context.getApplicationContext())
            .areNotificationsEnabled();
}

Post a Comment for "Checking If Notifications Are Enabled For Specific Package"