@umituz/react-native-notifications 1.0.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 (78) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +93 -0
  3. package/lib/index.d.ts +13 -0
  4. package/lib/index.d.ts.map +1 -0
  5. package/lib/index.js +15 -0
  6. package/lib/index.js.map +1 -0
  7. package/lib/infrastructure/config/notificationsConfig.d.ts +20 -0
  8. package/lib/infrastructure/config/notificationsConfig.d.ts.map +1 -0
  9. package/lib/infrastructure/config/notificationsConfig.js +81 -0
  10. package/lib/infrastructure/config/notificationsConfig.js.map +1 -0
  11. package/lib/infrastructure/hooks/actions/useNotificationActions.d.ts +17 -0
  12. package/lib/infrastructure/hooks/actions/useNotificationActions.d.ts.map +1 -0
  13. package/lib/infrastructure/hooks/actions/useNotificationActions.js +141 -0
  14. package/lib/infrastructure/hooks/actions/useNotificationActions.js.map +1 -0
  15. package/lib/infrastructure/hooks/state/useNotificationsState.d.ts +12 -0
  16. package/lib/infrastructure/hooks/state/useNotificationsState.d.ts.map +1 -0
  17. package/lib/infrastructure/hooks/state/useNotificationsState.js +30 -0
  18. package/lib/infrastructure/hooks/state/useNotificationsState.js.map +1 -0
  19. package/lib/infrastructure/hooks/types.d.ts +87 -0
  20. package/lib/infrastructure/hooks/types.d.ts.map +1 -0
  21. package/lib/infrastructure/hooks/types.js +8 -0
  22. package/lib/infrastructure/hooks/types.js.map +1 -0
  23. package/lib/infrastructure/hooks/useNotificationSettings.d.ts +10 -0
  24. package/lib/infrastructure/hooks/useNotificationSettings.d.ts.map +1 -0
  25. package/lib/infrastructure/hooks/useNotificationSettings.js +43 -0
  26. package/lib/infrastructure/hooks/useNotificationSettings.js.map +1 -0
  27. package/lib/infrastructure/hooks/useNotifications.d.ts +23 -0
  28. package/lib/infrastructure/hooks/useNotifications.d.ts.map +1 -0
  29. package/lib/infrastructure/hooks/useNotifications.js +51 -0
  30. package/lib/infrastructure/hooks/useNotifications.js.map +1 -0
  31. package/lib/infrastructure/hooks/utils/useNotificationRefresh.d.ts +13 -0
  32. package/lib/infrastructure/hooks/utils/useNotificationRefresh.d.ts.map +1 -0
  33. package/lib/infrastructure/hooks/utils/useNotificationRefresh.js +82 -0
  34. package/lib/infrastructure/hooks/utils/useNotificationRefresh.js.map +1 -0
  35. package/lib/infrastructure/services/NotificationManager.d.ts +138 -0
  36. package/lib/infrastructure/services/NotificationManager.d.ts.map +1 -0
  37. package/lib/infrastructure/services/NotificationManager.js +284 -0
  38. package/lib/infrastructure/services/NotificationManager.js.map +1 -0
  39. package/lib/infrastructure/services/NotificationService.d.ts +30 -0
  40. package/lib/infrastructure/services/NotificationService.d.ts.map +1 -0
  41. package/lib/infrastructure/services/NotificationService.js +41 -0
  42. package/lib/infrastructure/services/NotificationService.js.map +1 -0
  43. package/lib/infrastructure/services/channels/ChannelManager.d.ts +18 -0
  44. package/lib/infrastructure/services/channels/ChannelManager.d.ts.map +1 -0
  45. package/lib/infrastructure/services/channels/ChannelManager.js +87 -0
  46. package/lib/infrastructure/services/channels/ChannelManager.js.map +1 -0
  47. package/lib/infrastructure/services/delivery/NotificationDelivery.d.ts +16 -0
  48. package/lib/infrastructure/services/delivery/NotificationDelivery.d.ts.map +1 -0
  49. package/lib/infrastructure/services/delivery/NotificationDelivery.js +57 -0
  50. package/lib/infrastructure/services/delivery/NotificationDelivery.js.map +1 -0
  51. package/lib/infrastructure/services/preferences/PreferencesManager.d.ts +18 -0
  52. package/lib/infrastructure/services/preferences/PreferencesManager.d.ts.map +1 -0
  53. package/lib/infrastructure/services/preferences/PreferencesManager.js +65 -0
  54. package/lib/infrastructure/services/preferences/PreferencesManager.js.map +1 -0
  55. package/lib/infrastructure/services/types.d.ts +89 -0
  56. package/lib/infrastructure/services/types.d.ts.map +1 -0
  57. package/lib/infrastructure/services/types.js +7 -0
  58. package/lib/infrastructure/services/types.js.map +1 -0
  59. package/lib/infrastructure/storage/NotificationsStore.d.ts +23 -0
  60. package/lib/infrastructure/storage/NotificationsStore.d.ts.map +1 -0
  61. package/lib/infrastructure/storage/NotificationsStore.js +25 -0
  62. package/lib/infrastructure/storage/NotificationsStore.js.map +1 -0
  63. package/package.json +62 -0
  64. package/src/index.ts +34 -0
  65. package/src/infrastructure/config/notificationsConfig.ts +98 -0
  66. package/src/infrastructure/hooks/actions/useNotificationActions.ts +233 -0
  67. package/src/infrastructure/hooks/state/useNotificationsState.ts +46 -0
  68. package/src/infrastructure/hooks/types.ts +83 -0
  69. package/src/infrastructure/hooks/useNotificationSettings.ts +45 -0
  70. package/src/infrastructure/hooks/useNotifications.ts +70 -0
  71. package/src/infrastructure/hooks/utils/useNotificationRefresh.ts +107 -0
  72. package/src/infrastructure/services/NotificationManager.ts +326 -0
  73. package/src/infrastructure/services/NotificationService.ts +50 -0
  74. package/src/infrastructure/services/channels/ChannelManager.ts +111 -0
  75. package/src/infrastructure/services/delivery/NotificationDelivery.ts +65 -0
  76. package/src/infrastructure/services/preferences/PreferencesManager.ts +77 -0
  77. package/src/infrastructure/services/types.ts +81 -0
  78. package/src/infrastructure/storage/NotificationsStore.ts +39 -0
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Notifications Store - Zustand State Management
3
+ * Simple offline-first notification state
4
+ * NO backend, NO user IDs, NO notification history
5
+ */
6
+
7
+ import { create } from 'zustand';
8
+
9
+ interface NotificationsStore {
10
+ // State
11
+ hasPermissions: boolean;
12
+ isInitialized: boolean;
13
+
14
+ // Actions
15
+ setPermissions: (granted: boolean) => void;
16
+ setInitialized: (initialized: boolean) => void;
17
+ }
18
+
19
+ export const useNotificationsStore = create<NotificationsStore>((set) => ({
20
+ hasPermissions: false,
21
+ isInitialized: false,
22
+
23
+ setPermissions: (granted) => set({ hasPermissions: granted }),
24
+ setInitialized: (initialized) => set({ isInitialized: initialized }),
25
+ }));
26
+
27
+ /**
28
+ * Hook for accessing notifications state
29
+ */
30
+ export const useNotifications = () => {
31
+ const { hasPermissions, isInitialized, setPermissions, setInitialized } = useNotificationsStore();
32
+
33
+ return {
34
+ hasPermissions,
35
+ isInitialized,
36
+ setPermissions,
37
+ setInitialized,
38
+ };
39
+ };