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

26 lines 819 B
let lastSetBadgeCount = 0; const badgeModule = { addListener: () => { }, removeListeners: () => { }, getBadgeCountAsync: async () => { return lastSetBadgeCount; }, setBadgeCountAsync: async (badgeCount, options) => { // If this module is loaded in SSR (NextJS), we can't modify the badge. // It also can't load the badgin module, that instantly invokes methods on window. if (typeof window === 'undefined') { return false; } const badgin = require('badgin'); if (badgeCount > 0) { badgin.set(badgeCount, options); } else { badgin.clear(); } lastSetBadgeCount = badgeCount; return true; }, }; export default badgeModule; //# sourceMappingURL=BadgeModule.web.js.map