UNPKG

expo-quest-notifications

Version:

A fork of [`expo-notifications`](https://github.com/expo/expo/tree/main/packages/expo-notifications) that provides two implementations: - The default `expo-notifications` for Android and iOS platforms. - A Meta Quest-compatible implementation that uses th

18 lines (14 loc) 767 B
import { UnavailabilityError } from 'expo-modules-core'; import BadgeModule from './BadgeModule'; /** * Fetches the number currently set as the badge of the app icon on device's home screen. A `0` value means that the badge is not displayed. * > **Note:** Not all Android launchers support application badges. If the launcher does not support icon badges, the method will always resolve to `0`. * @return Returns a Promise resolving to a number that represents the current badge of the app icon. * @header badge */ export default async function getBadgeCountAsync(): Promise<number> { if (!BadgeModule.getBadgeCountAsync) { throw new UnavailabilityError('ExpoNotifications', 'getBadgeCountAsync'); } return await BadgeModule.getBadgeCountAsync(); }