0

I am using ShortcutBadger (https://github.com/leolin310148/ShortcutBadger) to display appbadges on the devices that support. I am sending a notification remotely and triggering the app badges. How do I count if the particular device triggered the app badge vs the device which does not support. Is there a callback for the same?

Mallik
  • 77
  • 7

1 Answers1

0

I was able to achieve this by querying the broadcast receivers in the phone. It worked most of the times for the required devices

private boolean supportAppbadge(Context context){

Intent i = new Intent("android.intent.action.BADGE_COUNT_UPDATE", null);
return context.getPackageManager().queryBroadcastReceivers(i, 0).size() >0;

}
Mallik
  • 77
  • 7