2

When I try to fetch the list of getEnabledListenerPackages I get an empty list.

NotificationManagerCompat.getEnabledListenerPackages(getContext()) 

returns null.

I know there are many apps which receive notifications what else needs to be done to get this to return a proper list.

alternatively is there any way of finding if user has disabled push for the app from settings

ir2pid
  • 5,604
  • 12
  • 63
  • 107

2 Answers2

1

According to this thread it seems that from 19+ you can know that notifications are enabled or not for your app. More precisely this is the call NotificationManagerCompat.areNotificationsEnabled().

Community
  • 1
  • 1
icastell
  • 3,495
  • 1
  • 19
  • 27
0

I solved this by taking an alternate route, as suggested from this post here

Community
  • 1
  • 1
ir2pid
  • 5,604
  • 12
  • 63
  • 107