【发布时间】:2016-06-04 00:55:52
【问题描述】:
我正在使用 ShortcutBadger (https://github.com/leolin310148/ShortcutBadger) 在支持的设备上显示 appbadges。我正在远程发送通知并触发应用程序徽章。如果特定设备触发了应用程序徽章与不支持的设备,我如何计算。有相同的回调吗?
【问题讨论】:
我正在使用 ShortcutBadger (https://github.com/leolin310148/ShortcutBadger) 在支持的设备上显示 appbadges。我正在远程发送通知并触发应用程序徽章。如果特定设备触发了应用程序徽章与不支持的设备,我如何计算。有相同的回调吗?
【问题讨论】:
我可以通过查询手机中的广播接收器来实现这一点。它大部分时间都适用于所需的设备
private boolean supportAppbadge(Context context){
Intent i = new Intent("android.intent.action.BADGE_COUNT_UPDATE", null);
return context.getPackageManager().queryBroadcastReceivers(i, 0).size() >0;
}
【讨论】: