Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_incrementIconBadgeNumberAsync = async () => {
const currentNumber = await Notifications.getBadgeNumberAsync();
await Notifications.setBadgeNumberAsync(currentNumber + 1);
const actualNumber = await Notifications.getBadgeNumberAsync();
Alert.alert(`Set the badge number to ${actualNumber}`);
}
_clearIconBadgeAsync = async () => {
await Notifications.setBadgeNumberAsync(0);
Alert.alert(`Cleared the badge`);
}