App Icon Badger Config
AppIconBadger feature represents the ability to use an external library to display the number of unread messages/events in a given UI (icon launcher, tab, ...).
This class represents the configuration related to this AppIconBadger feature and make possible to integrate automatically any badger libraries.
The following example gives an idea how to integrate a given badger library (like: ShortcutBadger library) or simply an internal API :
Initialization :
public class DemoImpl implements IAppIconBadgerProvider {
public void refreshAppIconBadger(Context context)
{
int unreadMessagesCount = 5;
ShortcutBadger.applyCount(context, unreadMessagesCount);
}
}
Content copied to clipboard
AppIconBadgerConfig builder =
new AppIconBadgerConfig
.Builder()
.appIconBadgerImpl(new DemoImpl())
.build();
SDKEnvironment.initAppIconBadger(builder);
Content copied to clipboard
IAppIconBadgerProvider appIconBadgerProvider =
SDKEnvironment.getAppIconBadger();
if (appIconBadgerProvider != null) {
appIconBadgerProvider.refreshAppIconBadger(context);
}
Content copied to clipboard