@umituz/react-native-notifications 1.1.6 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/package.json +18 -40
  2. package/src/index.ts +84 -13
  3. package/src/infrastructure/config/reminderPresets.ts +120 -0
  4. package/src/infrastructure/hooks/useQuietHoursActions.ts +52 -0
  5. package/src/infrastructure/hooks/useReminderActions.ts +147 -0
  6. package/src/infrastructure/services/types.ts +137 -44
  7. package/src/infrastructure/storage/RemindersStore.ts +150 -0
  8. package/src/presentation/components/FormButton.tsx +66 -0
  9. package/src/presentation/components/FrequencySelector.tsx +72 -0
  10. package/src/presentation/components/NotificationsSection.tsx +96 -159
  11. package/src/presentation/components/QuietHoursCard.tsx +105 -0
  12. package/src/presentation/components/ReminderForm.tsx +165 -0
  13. package/src/presentation/components/ReminderItem.tsx +124 -0
  14. package/src/presentation/components/TimePresetSelector.tsx +100 -0
  15. package/src/presentation/components/WeekdaySelector.tsx +61 -0
  16. package/src/presentation/screens/NotificationSettingsScreen.tsx +210 -0
  17. package/src/presentation/screens/ReminderListScreen.tsx +138 -0
  18. package/src/types/global.d.ts +11 -8
  19. package/lib/index.d.ts +0 -16
  20. package/lib/index.d.ts.map +0 -1
  21. package/lib/index.js +0 -23
  22. package/lib/index.js.map +0 -1
  23. package/lib/infrastructure/config/notificationsConfig.d.ts +0 -20
  24. package/lib/infrastructure/config/notificationsConfig.d.ts.map +0 -1
  25. package/lib/infrastructure/config/notificationsConfig.js +0 -81
  26. package/lib/infrastructure/config/notificationsConfig.js.map +0 -1
  27. package/lib/infrastructure/hooks/actions/useNotificationActions.d.ts +0 -7
  28. package/lib/infrastructure/hooks/actions/useNotificationActions.d.ts.map +0 -1
  29. package/lib/infrastructure/hooks/actions/useNotificationActions.js +0 -75
  30. package/lib/infrastructure/hooks/actions/useNotificationActions.js.map +0 -1
  31. package/lib/infrastructure/hooks/actions/useNotificationManagementActions.d.ts +0 -8
  32. package/lib/infrastructure/hooks/actions/useNotificationManagementActions.d.ts.map +0 -1
  33. package/lib/infrastructure/hooks/actions/useNotificationManagementActions.js +0 -78
  34. package/lib/infrastructure/hooks/actions/useNotificationManagementActions.js.map +0 -1
  35. package/lib/infrastructure/hooks/state/useNotificationsState.d.ts +0 -12
  36. package/lib/infrastructure/hooks/state/useNotificationsState.d.ts.map +0 -1
  37. package/lib/infrastructure/hooks/state/useNotificationsState.js +0 -30
  38. package/lib/infrastructure/hooks/state/useNotificationsState.js.map +0 -1
  39. package/lib/infrastructure/hooks/types.d.ts +0 -87
  40. package/lib/infrastructure/hooks/types.d.ts.map +0 -1
  41. package/lib/infrastructure/hooks/types.js +0 -8
  42. package/lib/infrastructure/hooks/types.js.map +0 -1
  43. package/lib/infrastructure/hooks/useNotificationSettings.d.ts +0 -10
  44. package/lib/infrastructure/hooks/useNotificationSettings.d.ts.map +0 -1
  45. package/lib/infrastructure/hooks/useNotificationSettings.js +0 -43
  46. package/lib/infrastructure/hooks/useNotificationSettings.js.map +0 -1
  47. package/lib/infrastructure/hooks/useNotifications.d.ts +0 -24
  48. package/lib/infrastructure/hooks/useNotifications.d.ts.map +0 -1
  49. package/lib/infrastructure/hooks/useNotifications.js +0 -72
  50. package/lib/infrastructure/hooks/useNotifications.js.map +0 -1
  51. package/lib/infrastructure/hooks/utils/useNotificationRefresh.d.ts +0 -8
  52. package/lib/infrastructure/hooks/utils/useNotificationRefresh.d.ts.map +0 -1
  53. package/lib/infrastructure/hooks/utils/useNotificationRefresh.js +0 -99
  54. package/lib/infrastructure/hooks/utils/useNotificationRefresh.js.map +0 -1
  55. package/lib/infrastructure/services/NotificationBadgeManager.d.ts +0 -5
  56. package/lib/infrastructure/services/NotificationBadgeManager.d.ts.map +0 -1
  57. package/lib/infrastructure/services/NotificationBadgeManager.js +0 -29
  58. package/lib/infrastructure/services/NotificationBadgeManager.js.map +0 -1
  59. package/lib/infrastructure/services/NotificationManager.d.ts +0 -59
  60. package/lib/infrastructure/services/NotificationManager.d.ts.map +0 -1
  61. package/lib/infrastructure/services/NotificationManager.js +0 -118
  62. package/lib/infrastructure/services/NotificationManager.js.map +0 -1
  63. package/lib/infrastructure/services/NotificationPermissions.d.ts +0 -6
  64. package/lib/infrastructure/services/NotificationPermissions.d.ts.map +0 -1
  65. package/lib/infrastructure/services/NotificationPermissions.js +0 -75
  66. package/lib/infrastructure/services/NotificationPermissions.js.map +0 -1
  67. package/lib/infrastructure/services/NotificationScheduler.d.ts +0 -8
  68. package/lib/infrastructure/services/NotificationScheduler.d.ts.map +0 -1
  69. package/lib/infrastructure/services/NotificationScheduler.js +0 -72
  70. package/lib/infrastructure/services/NotificationScheduler.js.map +0 -1
  71. package/lib/infrastructure/services/NotificationService.d.ts +0 -30
  72. package/lib/infrastructure/services/NotificationService.d.ts.map +0 -1
  73. package/lib/infrastructure/services/NotificationService.js +0 -41
  74. package/lib/infrastructure/services/NotificationService.js.map +0 -1
  75. package/lib/infrastructure/services/channels/ChannelManager.d.ts +0 -18
  76. package/lib/infrastructure/services/channels/ChannelManager.d.ts.map +0 -1
  77. package/lib/infrastructure/services/channels/ChannelManager.js +0 -87
  78. package/lib/infrastructure/services/channels/ChannelManager.js.map +0 -1
  79. package/lib/infrastructure/services/delivery/NotificationDelivery.d.ts +0 -10
  80. package/lib/infrastructure/services/delivery/NotificationDelivery.d.ts.map +0 -1
  81. package/lib/infrastructure/services/delivery/NotificationDelivery.js +0 -71
  82. package/lib/infrastructure/services/delivery/NotificationDelivery.js.map +0 -1
  83. package/lib/infrastructure/services/preferences/PreferencesManager.d.ts +0 -18
  84. package/lib/infrastructure/services/preferences/PreferencesManager.d.ts.map +0 -1
  85. package/lib/infrastructure/services/preferences/PreferencesManager.js +0 -65
  86. package/lib/infrastructure/services/preferences/PreferencesManager.js.map +0 -1
  87. package/lib/infrastructure/services/types.d.ts +0 -89
  88. package/lib/infrastructure/services/types.d.ts.map +0 -1
  89. package/lib/infrastructure/services/types.js +0 -7
  90. package/lib/infrastructure/services/types.js.map +0 -1
  91. package/lib/infrastructure/storage/NotificationsStore.d.ts +0 -23
  92. package/lib/infrastructure/storage/NotificationsStore.d.ts.map +0 -1
  93. package/lib/infrastructure/storage/NotificationsStore.js +0 -26
  94. package/lib/infrastructure/storage/NotificationsStore.js.map +0 -1
  95. package/lib/infrastructure/utils/dev.d.ts +0 -5
  96. package/lib/infrastructure/utils/dev.d.ts.map +0 -1
  97. package/lib/infrastructure/utils/dev.js +0 -24
  98. package/lib/infrastructure/utils/dev.js.map +0 -1
  99. package/lib/presentation/components/NotificationsSection.d.ts +0 -17
  100. package/lib/presentation/components/NotificationsSection.d.ts.map +0 -1
  101. package/lib/presentation/components/NotificationsSection.js +0 -132
  102. package/lib/presentation/components/NotificationsSection.js.map +0 -1
  103. package/lib/presentation/screens/NotificationsScreen.d.ts +0 -20
  104. package/lib/presentation/screens/NotificationsScreen.d.ts.map +0 -1
  105. package/lib/presentation/screens/NotificationsScreen.js +0 -74
  106. package/lib/presentation/screens/NotificationsScreen.js.map +0 -1
  107. package/src/__tests__/NotificationManager.test.ts +0 -215
  108. package/src/__tests__/useNotificationActions.test.ts +0 -189
  109. package/src/__tests__/useNotificationRefresh.test.ts +0 -213
  110. package/src/infrastructure/hooks/actions/useNotificationActions.ts +0 -131
  111. package/src/infrastructure/hooks/actions/useNotificationManagementActions.ts +0 -131
  112. package/src/infrastructure/hooks/state/useNotificationsState.ts +0 -46
  113. package/src/infrastructure/hooks/types.ts +0 -83
  114. package/src/infrastructure/hooks/useNotifications.ts +0 -96
  115. package/src/infrastructure/hooks/utils/useNotificationRefresh.ts +0 -131
  116. package/src/infrastructure/services/channels/ChannelManager.ts +0 -111
  117. package/src/infrastructure/services/delivery/NotificationDelivery.ts +0 -83
  118. package/src/infrastructure/services/preferences/PreferencesManager.ts +0 -77
@@ -1,99 +0,0 @@
1
- import { useCallback, useRef } from 'react';
2
- import AsyncStorage from '@react-native-async-storage/async-storage';
3
- import { ChannelManager } from '../../services/channels/ChannelManager';
4
- import { PreferencesManager } from '../../services/preferences/PreferencesManager';
5
- import { devLog, devError } from '../../utils/dev';
6
- export const useNotificationRefresh = (pageSize, setters) => {
7
- const { setNotifications, setUnreadCount, setChannels, setPreferences, setLoading, setError, setHasMore, } = setters;
8
- const channelManager = useRef(new ChannelManager()).current;
9
- const preferencesManager = useRef(new PreferencesManager()).current;
10
- const abortController = useRef(null);
11
- const cleanup = useCallback(() => {
12
- if (abortController.current) {
13
- abortController.current.abort();
14
- abortController.current = null;
15
- }
16
- }, []);
17
- const refreshNotifications = useCallback(async () => {
18
- try {
19
- cleanup();
20
- abortController.current = new AbortController();
21
- setLoading(true);
22
- setError(null);
23
- const data = await AsyncStorage.getItem('@notifications:list');
24
- const allNotifications = data ? JSON.parse(data) : [];
25
- const paginated = allNotifications.slice(0, pageSize);
26
- const unread = allNotifications.filter((n) => !n.read).length;
27
- setNotifications(paginated);
28
- setUnreadCount(unread);
29
- setHasMore(allNotifications.length > pageSize);
30
- devLog('[useNotificationRefresh] Refreshed notifications:', paginated.length);
31
- }
32
- catch (err) {
33
- if (err instanceof Error && err.name === 'AbortError') {
34
- return;
35
- }
36
- setError(err instanceof Error ? err.message : 'Failed to load notifications');
37
- }
38
- finally {
39
- setLoading(false);
40
- cleanup();
41
- }
42
- }, [pageSize, setNotifications, setUnreadCount, setHasMore, setLoading, setError, cleanup]);
43
- const loadMoreNotifications = useCallback(async (currentLength, hasMore, loading) => {
44
- if (!hasMore || loading)
45
- return;
46
- try {
47
- cleanup();
48
- abortController.current = new AbortController();
49
- setLoading(true);
50
- setError(null);
51
- const data = await AsyncStorage.getItem('@notifications:list');
52
- const allNotifications = data ? JSON.parse(data) : [];
53
- const moreNotifications = allNotifications.slice(currentLength, currentLength + pageSize);
54
- setNotifications((prev) => [...prev, ...moreNotifications]);
55
- setHasMore(allNotifications.length > currentLength + pageSize);
56
- devLog('[useNotificationRefresh] Loaded more notifications:', moreNotifications.length);
57
- }
58
- catch (err) {
59
- if (err instanceof Error && err.name === 'AbortError') {
60
- return;
61
- }
62
- setError(err instanceof Error
63
- ? err.message
64
- : 'Failed to load more notifications');
65
- }
66
- finally {
67
- setLoading(false);
68
- cleanup();
69
- }
70
- }, [pageSize, setNotifications, setHasMore, setLoading, setError, cleanup]);
71
- const refreshChannels = useCallback(async () => {
72
- try {
73
- const channelsData = await channelManager.getActiveChannels();
74
- setChannels(channelsData);
75
- devLog('[useNotificationRefresh] Refreshed channels:', channelsData.length);
76
- }
77
- catch (err) {
78
- devError('[useNotificationRefresh] Failed to refresh channels:', err);
79
- }
80
- }, [setChannels]);
81
- const refreshPreferences = useCallback(async () => {
82
- try {
83
- const prefsData = await preferencesManager.get();
84
- setPreferences(prefsData);
85
- devLog('[useNotificationRefresh] Refreshed preferences');
86
- }
87
- catch (err) {
88
- devError('[useNotificationRefresh] Failed to refresh preferences:', err);
89
- }
90
- }, [setPreferences]);
91
- return {
92
- refreshNotifications,
93
- loadMoreNotifications,
94
- refreshChannels,
95
- refreshPreferences,
96
- cleanup,
97
- };
98
- };
99
- //# sourceMappingURL=useNotificationRefresh.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useNotificationRefresh.js","sourceRoot":"","sources":["../../../../src/infrastructure/hooks/utils/useNotificationRefresh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,YAAY,MAAM,2CAA2C,CAAC;AAErE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,QAAgB,EAAE,OAAY,EAAE,EAAE;IACvE,MAAM,EACJ,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,cAAc,EACd,UAAU,EACV,QAAQ,EACR,UA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CAAC;QAC3D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,yDAAyD,EAAE,GAAG,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO;QACL,oBAAoB;QACpB,qBAAqB;QACrB,eAAe;QACf,kBAAkB;QAClB,OAAO;KACR,CAAC;AACJ,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare class NotificationBadgeManager {
2
- getBadgeCount(): Promise<number>;
3
- setBadgeCount(count: number): Promise<void>;
4
- }
5
- //# sourceMappingURL=NotificationBadgeManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationBadgeManager.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/services/NotificationBadgeManager.ts"],"names":[],"mappings":"AAIA,qBAAa,wBAAwB;IAC7B,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAYhC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAUlD"}
@@ -1,29 +0,0 @@
1
- import * as Notifications from 'expo-notifications';
2
- import { Platform } from 'react-native';
3
- import { devError } from '../utils/dev';
4
- export class NotificationBadgeManager {
5
- async getBadgeCount() {
6
- try {
7
- if (Platform.OS === 'ios') {
8
- return await Notifications.getBadgeCountAsync();
9
- }
10
- return 0;
11
- }
12
- catch (error) {
13
- devError('[NotificationBadgeManager] Get badge count failed:', error);
14
- return 0;
15
- }
16
- }
17
- async setBadgeCount(count) {
18
- try {
19
- if (Platform.OS === 'ios') {
20
- await Notifications.setBadgeCountAsync(count);
21
- }
22
- }
23
- catch (error) {
24
- devError('[NotificationBadgeManager] Set badge count failed:', error);
25
- throw error;
26
- }
27
- }
28
- }
29
- //# sourceMappingURL=NotificationBadgeManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationBadgeManager.js","sourceRoot":"","sources":["../../../src/infrastructure/services/NotificationBadgeManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,OAAO,wBAAwB;IACnC,KAAK,CAAC,aAAa;QACjB,IAAI,CAAC;YACH,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;gBAC1B,OAAO,MAAM,aAAa,CAAC,kBAAkB,EAAE,CAAC;YAClD,CAAC;YACD,OAAO,CAAC,CAAC;QACX,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,QAAQ,CAAC,oDAAoD,EAAE,KAAK,CAAC,CAAC;YACtE,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,KAAa;QAC/B,IAAI,CAAC;YACH,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;gBAC1B,MAAM,aAAa,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAChD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,QAAQ,CAAC,oDAAoD,EAAE,KAAK,CAAC,CAAC;YACtE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
@@ -1,59 +0,0 @@
1
- /**
2
- * NotificationManager - Core Notification Operations
3
- *
4
- * Offline-first notification system using expo-notifications.
5
- * Works in ALL apps (offline, online, hybrid) - no backend required.
6
- */
7
- export type NotificationTrigger = {
8
- type: 'date';
9
- date: Date;
10
- } | {
11
- type: 'daily';
12
- hour: number;
13
- minute: number;
14
- } | {
15
- type: 'weekly';
16
- weekday: number;
17
- hour: number;
18
- minute: number;
19
- } | {
20
- type: 'monthly';
21
- day: number;
22
- hour: number;
23
- minute: number;
24
- };
25
- export interface ScheduleNotificationOptions {
26
- title: string;
27
- body: string;
28
- data?: Record<string, any>;
29
- trigger: NotificationTrigger;
30
- sound?: boolean | string;
31
- badge?: number;
32
- categoryIdentifier?: string;
33
- }
34
- export interface ScheduledNotification {
35
- identifier: string;
36
- content: {
37
- title: string;
38
- body: string;
39
- data: Record<string, any>;
40
- };
41
- trigger: any;
42
- }
43
- export declare class NotificationManager {
44
- private permissions;
45
- private scheduler;
46
- private badgeManager;
47
- constructor();
48
- static configure(): void;
49
- requestPermissions(): Promise<boolean>;
50
- hasPermissions(): Promise<boolean>;
51
- scheduleNotification(options: ScheduleNotificationOptions): Promise<string>;
52
- cancelNotification(notificationId: string): Promise<void>;
53
- cancelAllNotifications(): Promise<void>;
54
- getScheduledNotifications(): Promise<ScheduledNotification[]>;
55
- dismissAllNotifications(): Promise<void>;
56
- getBadgeCount(): Promise<number>;
57
- setBadgeCount(count: number): Promise<void>;
58
- }
59
- //# sourceMappingURL=NotificationManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationManager.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/services/NotificationManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACjE;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC3B,CAAC;IACF,OAAO,EAAE,GAAG,CAAC;CACd;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,WAAW,CAA0B;IAC7C,OAAO,CAAC,SAAS,CAAwB;IACzC,OAAO,CAAC,YAAY,CAA2B;;IAQ/C,MAAM,CAAC,SAAS;IAYV,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IAatC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IASlC,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IAa3E,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWzD,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAWvC,yBAAyB,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAS7D,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;IAWxC,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAShC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAUlD"}
@@ -1,118 +0,0 @@
1
- /**
2
- * NotificationManager - Core Notification Operations
3
- *
4
- * Offline-first notification system using expo-notifications.
5
- * Works in ALL apps (offline, online, hybrid) - no backend required.
6
- */
7
- import * as Notifications from 'expo-notifications';
8
- import { NotificationPermissions } from './NotificationPermissions';
9
- import { NotificationScheduler } from './NotificationScheduler';
10
- import { NotificationBadgeManager } from './NotificationBadgeManager';
11
- import { devLog, devError } from '../utils/dev';
12
- export class NotificationManager {
13
- constructor() {
14
- this.permissions = new NotificationPermissions();
15
- this.scheduler = new NotificationScheduler();
16
- this.badgeManager = new NotificationBadgeManager();
17
- }
18
- static configure() {
19
- Notifications.setNotificationHandler({
20
- handleNotification: async () => ({
21
- shouldShowAlert: true,
22
- shouldPlaySound: true,
23
- shouldSetBadge: true,
24
- }),
25
- });
26
- devLog('[NotificationManager] Configured notification handler');
27
- }
28
- async requestPermissions() {
29
- try {
30
- const result = await this.permissions.requestPermissions();
31
- devLog('[NotificationManager] Permissions requested:', result);
32
- return result;
33
- }
34
- catch (error) {
35
- devError('[NotificationManager] Permission request failed:', error);
36
- return false;
37
- }
38
- }
39
- async hasPermissions() {
40
- try {
41
- return await this.permissions.hasPermissions();
42
- }
43
- catch (error) {
44
- devError('[NotificationManager] Permission check failed:', error);
45
- return false;
46
- }
47
- }
48
- async scheduleNotification(options) {
49
- try {
50
- const id = await this.scheduler.scheduleNotification(options);
51
- devLog('[NotificationManager] Notification scheduled:', id);
52
- return id;
53
- }
54
- catch (error) {
55
- devError('[NotificationManager] Schedule notification failed:', error);
56
- throw error;
57
- }
58
- }
59
- async cancelNotification(notificationId) {
60
- try {
61
- await this.scheduler.cancelNotification(notificationId);
62
- devLog('[NotificationManager] Notification cancelled:', notificationId);
63
- }
64
- catch (error) {
65
- devError('[NotificationManager] Cancel notification failed:', error);
66
- throw error;
67
- }
68
- }
69
- async cancelAllNotifications() {
70
- try {
71
- await this.scheduler.cancelAllNotifications();
72
- devLog('[NotificationManager] All notifications cancelled');
73
- }
74
- catch (error) {
75
- devError('[NotificationManager] Cancel all notifications failed:', error);
76
- throw error;
77
- }
78
- }
79
- async getScheduledNotifications() {
80
- try {
81
- return await this.scheduler.getScheduledNotifications();
82
- }
83
- catch (error) {
84
- devError('[NotificationManager] Get scheduled notifications failed:', error);
85
- return [];
86
- }
87
- }
88
- async dismissAllNotifications() {
89
- try {
90
- await Notifications.dismissAllNotificationsAsync();
91
- devLog('[NotificationManager] All notifications dismissed');
92
- }
93
- catch (error) {
94
- devError('[NotificationManager] Dismiss all notifications failed:', error);
95
- throw error;
96
- }
97
- }
98
- async getBadgeCount() {
99
- try {
100
- return await this.badgeManager.getBadgeCount();
101
- }
102
- catch (error) {
103
- devError('[NotificationManager] Get badge count failed:', error);
104
- return 0;
105
- }
106
- }
107
- async setBadgeCount(count) {
108
- try {
109
- await this.badgeManager.setBadgeCount(count);
110
- devLog('[NotificationManager] Badge count set:', count);
111
- }
112
- catch (error) {
113
- devError('[NotificationManager] Set badge count failed:', error);
114
- throw error;
115
- }
116
- }
117
- }
118
- //# sourceMappingURL=NotificationManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationManager.js","sourceRoot":"","sources":["../../../src/infrastructure/services/NotificationManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AA4BhD,MAAM,OAAO,mBAAmB;IAK9B;QACE,IAAI,CAAC,WAAW,GAAG,IAAI,uBAAuB,EAAE,CAAC;QACjD,IAAI,CAAC,SAAS,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAC7C,IAAI,CAAC,YAAY,GAAG,IAAI,wBAAwB,EAAE,CAAC;IACrD,CAAC;IAED,MAAM,CAAC,SAAS;QACd,aAAa,CAAC,sBAAsB,CAAC;YACnC,kBAAkB,EAAE,KAAK,IAAI,EAAE,CAA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a,CAAC,KAAa;QAC/B,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAE7C,MAAM,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;QAC1D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,QAAQ,CAAC,+CAA+C,EAAE,KAAK,CAAC,CAAC;YACjE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
@@ -1,6 +0,0 @@
1
- export declare class NotificationPermissions {
2
- requestPermissions(): Promise<boolean>;
3
- hasPermissions(): Promise<boolean>;
4
- private createAndroidChannels;
5
- }
6
- //# sourceMappingURL=NotificationPermissions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationPermissions.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/services/NotificationPermissions.ts"],"names":[],"mappings":"AAKA,qBAAa,uBAAuB;IAC5B,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IA2BtC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;YAW1B,qBAAqB;CAmCpC"}
@@ -1,75 +0,0 @@
1
- import * as Notifications from 'expo-notifications';
2
- import * as Device from 'expo-device';
3
- import { Platform } from 'react-native';
4
- import { devWarn, devError, devLog } from '../utils/dev';
5
- export class NotificationPermissions {
6
- async requestPermissions() {
7
- try {
8
- if (!Device.isDevice) {
9
- devWarn('[NotificationPermissions] Notifications only work on physical devices');
10
- return false;
11
- }
12
- const permissionsResponse = await Notifications.getPermissionsAsync();
13
- const existingStatus = permissionsResponse.status || (permissionsResponse.granted ? 'granted' : 'denied');
14
- let finalStatus = existingStatus;
15
- if (existingStatus !== 'granted') {
16
- const requestResponse = await Notifications.requestPermissionsAsync();
17
- finalStatus = requestResponse.status || (requestResponse.granted ? 'granted' : 'denied');
18
- }
19
- if (Platform.OS === 'android') {
20
- await this.createAndroidChannels();
21
- }
22
- return finalStatus === 'granted';
23
- }
24
- catch (error) {
25
- devError('[NotificationPermissions] Permission request failed:', error);
26
- return false;
27
- }
28
- }
29
- async hasPermissions() {
30
- try {
31
- if (!Device.isDevice)
32
- return false;
33
- const permissionsResponse = await Notifications.getPermissionsAsync();
34
- return permissionsResponse.status === 'granted' || permissionsResponse.granted === true;
35
- }
36
- catch (error) {
37
- devError('[NotificationPermissions] Permission check failed:', error);
38
- return false;
39
- }
40
- }
41
- async createAndroidChannels() {
42
- if (Platform.OS !== 'android')
43
- return;
44
- try {
45
- await Notifications.setNotificationChannelAsync('default', {
46
- name: 'Default',
47
- importance: Notifications.AndroidImportance.DEFAULT,
48
- vibrationPattern: [0, 250, 250, 250],
49
- sound: 'default',
50
- lightColor: '#3B82F6',
51
- });
52
- await Notifications.setNotificationChannelAsync('reminders', {
53
- name: 'Reminders',
54
- importance: Notifications.AndroidImportance.HIGH,
55
- vibrationPattern: [0, 250, 250, 250],
56
- sound: 'default',
57
- lightColor: '#3B82F6',
58
- enableVibrate: true,
59
- });
60
- await Notifications.setNotificationChannelAsync('urgent', {
61
- name: 'Urgent',
62
- importance: Notifications.AndroidImportance.MAX,
63
- vibrationPattern: [0, 500, 250, 500],
64
- sound: 'default',
65
- lightColor: '#EF4444',
66
- enableVibrate: true,
67
- });
68
- devLog('[NotificationPermissions] Android channels created');
69
- }
70
- catch (error) {
71
- devError('[NotificationPermissions] Android channel creation failed:', error);
72
- }
73
- }
74
- }
75
- //# sourceMappingURL=NotificationPermissions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationPermissions.js","sourceRoot":"","sources":["../../../src/infrastructure/services/NotificationPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,OAAO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;IACH,CAAC;CACF"}
@@ -1,8 +0,0 @@
1
- import type { ScheduleNotificationOptions, ScheduledNotification } from './NotificationManager';
2
- export declare class NotificationScheduler {
3
- scheduleNotification(options: ScheduleNotificationOptions): Promise<string>;
4
- cancelNotification(notificationId: string): Promise<void>;
5
- cancelAllNotifications(): Promise<void>;
6
- getScheduledNotifications(): Promise<ScheduledNotification[]>;
7
- }
8
- //# sourceMappingURL=NotificationScheduler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationScheduler.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/services/NotificationScheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAuB,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAErH,qBAAa,qBAAqB;IAC1B,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IAoD3E,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvC,yBAAyB,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC;CAYpE"}
@@ -1,72 +0,0 @@
1
- import * as Notifications from 'expo-notifications';
2
- export class NotificationScheduler {
3
- async scheduleNotification(options) {
4
- const { title, body, data = {}, trigger, sound = true, badge, categoryIdentifier } = options;
5
- let notificationTrigger;
6
- if (trigger.type === 'date') {
7
- notificationTrigger = {
8
- date: trigger.date,
9
- channelId: categoryIdentifier || 'default',
10
- };
11
- }
12
- else if (trigger.type === 'daily') {
13
- notificationTrigger = {
14
- hour: trigger.hour,
15
- minute: trigger.minute,
16
- repeats: true,
17
- channelId: categoryIdentifier || 'reminders',
18
- };
19
- }
20
- else if (trigger.type === 'weekly') {
21
- notificationTrigger = {
22
- weekday: trigger.weekday,
23
- hour: trigger.hour,
24
- minute: trigger.minute,
25
- repeats: true,
26
- channelId: categoryIdentifier || 'reminders',
27
- };
28
- }
29
- else if (trigger.type === 'monthly') {
30
- notificationTrigger = {
31
- day: trigger.day,
32
- hour: trigger.hour,
33
- minute: trigger.minute,
34
- repeats: true,
35
- channelId: categoryIdentifier || 'reminders',
36
- };
37
- }
38
- const notificationId = await Notifications.scheduleNotificationAsync({
39
- content: {
40
- title,
41
- body,
42
- data,
43
- sound: sound === true ? 'default' : sound || undefined,
44
- badge,
45
- categoryIdentifier,
46
- priority: Notifications.AndroidNotificationPriority.HIGH,
47
- vibrate: [0, 250, 250, 250],
48
- },
49
- trigger: notificationTrigger,
50
- });
51
- return notificationId;
52
- }
53
- async cancelNotification(notificationId) {
54
- await Notifications.cancelScheduledNotificationAsync(notificationId);
55
- }
56
- async cancelAllNotifications() {
57
- await Notifications.cancelAllScheduledNotificationsAsync();
58
- }
59
- async getScheduledNotifications() {
60
- const notifications = await Notifications.getAllScheduledNotificationsAsync();
61
- return notifications.map(notification => ({
62
- identifier: notification.identifier,
63
- content: {
64
- title: notification.content.title || '',
65
- body: notification.content.body || '',
66
- data: notification.content.data,
67
- },
68
- trigger: notification.trigger,
69
- }));
70
- }
71
- }
72
- //# sourceMappingURL=NotificationScheduler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationScheduler.js","sourceRoot":"","sources":["../../../src/infrastructure/services/NotificationScheduler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AAGpD,MAAM,OAAO,qBAAqB;IAChC,KAAK,CAAC,oBAAoB,CAAC,OAAoC;QAC7D,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC;QAE7F,IAAI,mBAAwB,CAAC;QAE7B,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC5B,mBAAmB,GAAG;gBACpB,IAAI,EAAE,OAAO,CAAC,IAA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OAAO,EAAE,mBAAmB;SAC7B,CAAC,CAAC;QAEH,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,cAAsB;QAC7C,MAAM,aAAa,CAAC,gCAAgC,CAAC,cAAc,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,MAAM,aAAa,CAAC,oCAAoC,EAAE,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,yBAAyB;QAC7B,MAAM,aAAa,GAAG,MAAM,aAAa,CAAC,iCAAiC,EAAE,CAAC;QAC9E,OAAO,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YACxC,UAAU,EAAE,YAAY,CAAC,UAAU;YACnC,OAAO,EAAE;gBACP,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE;gBACvC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE;gBACrC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,IAA2B;aACvD;YACD,OAAO,EAAE,YAAY,CAAC,OAAO;SAC9B,CAAC,CAAC,CAAC;IACN,CAAC;CACF"}
@@ -1,30 +0,0 @@
1
- /**
2
- * NotificationService
3
- *
4
- * Simple facade for offline notification system.
5
- * Works in ALL apps - offline, online, hybrid - no backend required.
6
- *
7
- * @module NotificationService
8
- */
9
- import { NotificationManager } from './NotificationManager';
10
- export * from './types';
11
- /**
12
- * Notification service singleton
13
- * Provides simple access to notification manager
14
- */
15
- export declare class NotificationService {
16
- private static instance;
17
- readonly notifications: NotificationManager;
18
- private constructor();
19
- static getInstance(): NotificationService;
20
- /**
21
- * Request notification permissions
22
- */
23
- requestPermissions(): Promise<boolean>;
24
- /**
25
- * Check if permissions are granted
26
- */
27
- hasPermissions(): Promise<boolean>;
28
- }
29
- export declare const notificationService: NotificationService;
30
- //# sourceMappingURL=NotificationService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationService.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/services/NotificationService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,cAAc,SAAS,CAAC;AAExB;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAsB;IAE7C,QAAQ,CAAC,aAAa,sBAA6B;IAEnD,OAAO;IAKP,MAAM,CAAC,WAAW,IAAI,mBAAmB;IAOzC;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IAI5C;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAGzC;AAED,eAAO,MAAM,mBAAmB,qBAAoC,CAAC"}
@@ -1,41 +0,0 @@
1
- /**
2
- * NotificationService
3
- *
4
- * Simple facade for offline notification system.
5
- * Works in ALL apps - offline, online, hybrid - no backend required.
6
- *
7
- * @module NotificationService
8
- */
9
- import { NotificationManager } from './NotificationManager';
10
- export * from './types';
11
- /**
12
- * Notification service singleton
13
- * Provides simple access to notification manager
14
- */
15
- export class NotificationService {
16
- constructor() {
17
- this.notifications = new NotificationManager();
18
- // Configure notification handler on initialization
19
- NotificationManager.configure();
20
- }
21
- static getInstance() {
22
- if (!NotificationService.instance) {
23
- NotificationService.instance = new NotificationService();
24
- }
25
- return NotificationService.instance;
26
- }
27
- /**
28
- * Request notification permissions
29
- */
30
- async requestPermissions() {
31
- return await this.notifications.requestPermissions();
32
- }
33
- /**
34
- * Check if permissions are granted
35
- */
36
- async hasPermissions() {
37
- return await this.notifications.hasPermissions();
38
- }
39
- }
40
- export const notificationService = NotificationService.getInstance();
41
- //# sourceMappingURL=NotificationService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationService.js","sourceRoot":"","sources":["../../../src/infrastructure/services/NotificationService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,cAAc,SAAS,CAAC;AAExB;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAK9B;QAFS,kBAAa,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAGjD,mDAAmD;QACnD,mBAAmB,CAAC,SAAS,EAAE,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,WAAW;QAChB,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,CAAC;YAClC,mBAAmB,CAAC,QAAQ,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAC3D,CAAC;QACD,OAAO,mBAAmB,CAAC,QAAQ,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB;QACtB,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,kBAAkB,EAAE,CAAC;IACvD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc;QAClB,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC;IACnD,CAAC;CACF;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,WAAW,EAAE,CAAC"}
@@ -1,18 +0,0 @@
1
- import type { NotificationChannel } from '../types';
2
- /**
3
- * ChannelManager - Offline Notification Channel Management
4
- *
5
- * Manages push notification tokens and preferences in AsyncStorage.
6
- * Only supports local push and in-app notifications.
7
- *
8
- * NO backend, NO email/SMS - pure offline.
9
- */
10
- export declare class ChannelManager {
11
- private static STORAGE_KEY;
12
- register(channelType: 'push' | 'in_app', preferences?: Record<string, any>): Promise<NotificationChannel | null>;
13
- verify(channelId: string): Promise<boolean>;
14
- getActiveChannels(): Promise<NotificationChannel[]>;
15
- private getAllChannels;
16
- private update;
17
- }
18
- //# sourceMappingURL=ChannelManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChannelManager.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/services/channels/ChannelManager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD;;;;;;;GAOG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,WAAW,CAA6B;IAEjD,QAAQ,CACZ,WAAW,EAAE,MAAM,GAAG,QAAQ,EAC9B,WAAW,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GACpC,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAgChC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAoB3C,iBAAiB,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;YAS3C,cAAc;YASd,MAAM;CAsBrB"}