AppIconBadgerConfig

open class AppIconBadgerConfig

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);
     }
}

AppIconBadgerConfig builder =
    new AppIconBadgerConfig
    .Builder()
	   .appIconBadgerImpl(new DemoImpl())
 	.build();

SDKEnvironment.initAppIconBadger(builder);
Implementation (update & refresh the count badger) :

IAppIconBadgerProvider appIconBadgerProvider =
    SDKEnvironment.getAppIconBadger();

if (appIconBadgerProvider != null) {
    appIconBadgerProvider.refreshAppIconBadger(context);
}

Types

Link copied to clipboard
open class Builder
The type Builder.

Properties

Link copied to clipboard
val appIconBadgerProvider: IAppIconBadgerProvider
The App icon badger provider.