How to add/remove the Badge count on an application icon?
■ Summary
- Badge API is responsible for showing the number of notifications on the icon of an application.
- If you want to use the Badge API, you need to add the following privilege in the config.xml.
- Badge API is responsible for showing the number of notifications on the icon of an application.
- If you want to use the Badge API, you need to add the following privilege in the config.xml.
/******************************************************
* Javascript File
******************************************************/
// Get the badge count
var appId = tizen.application.getCurrentApplication().appInfo.id;
var badgeCount = tizen.badge.getBadgeCount(appId);
// Set the badge count
var appId = tizen.application.getCurrentApplication().appInfo.id;
var badgeCount = 7;
tizen.badge.setBadgeCount(appId, badgeCount);
/******************************************************
* Config.xml
******************************************************/
<tizen:privilege name="http://tizen.org/privilege/notification"/>