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.
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/******************************************************
*                   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"/>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Tags :
Badge