Skip to content

Instantly share code, notes, and snippets.

@MartinZikmund
Created September 1, 2021 22:35
Show Gist options
  • Save MartinZikmund/972a4a1d85d07ae7eeb8a8f8da622609 to your computer and use it in GitHub Desktop.
Save MartinZikmund/972a4a1d85d07ae7eeb8a8f8da622609 to your computer and use it in GitHub Desktop.
BadgeUpdater.ts
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