Created
September 1, 2021 22:35
-
-
Save MartinZikmund/972a4a1d85d07ae7eeb8a8f8da622609 to your computer and use it in GitHub Desktop.
BadgeUpdater.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Navigator { | |
setAppBadge(value: number): void; | |
clearAppBadge(): void; | |
} | |
namespace Windows.UI.Notifications { | |
export class BadgeUpdater { | |
public static setNumber(value: number) { | |
if (navigator.setAppBadge) { | |
navigator.setAppBadge(value); | |
} | |
} | |
public static clear() { | |
if (navigator.clearAppBadge) { | |
navigator.clearAppBadge(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment