Open stefanwilliam96 opened 5 years ago
As seen on the documentation, there is a 'badge' property for notification object.
Property Badge Type Number Description The number currently set as the badge of the app icon in Springboard (iOS) or at the right-hand side of the local notification (Android) - Default: 0 (which means don't show a number)
So I think you could use something like this :
// Set your desired value here or increment it from previous actions
var badgeNum = 1;
// Change some default values here
cordova.plugins.notification.local.setDefaults({
badge: badgeNum
});
I didn't try it but it should work. Hope it helps !
As seen on the documentation, there is a 'badge' property for notification object.
Property Badge Type Number Description The number currently set as the badge of the app icon in Springboard (iOS) or at the right-hand side of the local notification (Android) - Default: 0 (which means don't show a number)
So I think you could use something like this :
// Set your desired value here or increment it from previous actions var badgeNum = 1; // Change some default values here cordova.plugins.notification.local.setDefaults({ badge: badgeNum });
I didn't try it but it should work. Hope it helps !
the problem is, this local notification plugin using badge plugin which didnt worked :v
@Katzer is also the creator of the badge plugin and said the following on this issue (https://github.com/katzer/cordova-plugin-badge/issues/124)
Please notice that the plugin only supports devices that are supported by ShortcutBadger. There's no error if its not possible to set a badge. The cordova plugin nor the underlying ShortcutBadger cannot know if its working or not because its not a core Android API.
I don't know where the problem come from but you could start by using the "IsBageWorking" tool provided on ShortcutBadger page : https://github.com/leolin310148/ShortcutBadger#isbadgeworking
A tool for displaying your device, launcher & android version and testing whether ShortcutBadger works or not may.
@katzer is also the creator of the badge plugin and said the following on this issue (katzer/cordova-plugin-badge#124)
Please notice that the plugin only supports devices that are supported by ShortcutBadger. There's no error if its not possible to set a badge. The cordova plugin nor the underlying ShortcutBadger cannot know if its working or not because its not a core Android API.
I don't know where the problem come from but you could start by using the "IsBageWorking" tool provided on ShortcutBadger page : https://github.com/leolin310148/ShortcutBadger#isbadgeworking
A tool for displaying your device, launcher & android version and testing whether ShortcutBadger works or not may.
yeah i know, i already try his badge plugin but didnt work for me lol xD anyway thanks for your answer
can local notification automatically generate badge in apps icon ?