react-native-alarmageddon 1.1.1 → 2.1.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 (150) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +169 -187
  3. package/android/build/.transforms/33d69af0aa8d226a34981fd71aab63e2/results.bin +1 -0
  4. package/android/build/.transforms/33d69af0aa8d226a34981fd71aab63e2/transformed/classes/classes_dex/classes.dex +0 -0
  5. package/android/build/.transforms/4aeb440f8cdf777de34ab1099140d239/results.bin +1 -0
  6. package/android/build/.transforms/4aeb440f8cdf777de34ab1099140d239/transformed/classes/classes_dex/classes.dex +0 -0
  7. package/android/build/generated/source/buildConfig/debug/com/rnalarmmodule/BuildConfig.java +10 -0
  8. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +41 -0
  9. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  10. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  11. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  12. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  13. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  14. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +1 -0
  15. package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_alarm_default.wav.flat +0 -0
  16. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +2 -0
  17. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  18. package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
  19. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  20. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  21. package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/react-native-alarmageddon_debug.kotlin_module +0 -0
  22. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnalarmmodule/BuildConfig.class +0 -0
  23. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +3 -0
  24. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +68 -0
  25. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +41 -0
  26. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  27. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  28. package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/alarm_default.wav +0 -0
  29. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  30. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +2 -0
  31. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  32. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  33. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  34. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  46. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  48. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  49. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  50. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  51. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  52. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  53. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  54. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  55. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  56. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  57. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  58. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  59. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  60. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  61. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  62. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  63. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  64. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  65. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  66. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  67. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  68. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  69. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  70. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  71. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  72. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  73. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  74. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  75. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  76. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  77. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  78. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  79. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  80. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  81. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  82. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  83. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  84. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  85. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  86. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  87. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  88. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  89. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  90. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  91. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  92. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  93. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  94. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
  95. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  96. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  97. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  98. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  99. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  100. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  101. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  102. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  103. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  104. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  105. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  106. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  107. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  108. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  109. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  110. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  111. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  112. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  113. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  114. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  115. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  116. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  117. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  118. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  119. package/android/build/outputs/logs/manifest-merger-debug-report.txt +71 -0
  120. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  121. package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-alarmageddon_debug.kotlin_module +0 -0
  122. package/android/build/tmp/kotlin-classes/debug/com/rnalarmmodule/AlarmModule$Companion.class +0 -0
  123. package/android/build/tmp/kotlin-classes/debug/com/rnalarmmodule/AlarmModule.class +0 -0
  124. package/android/build/tmp/kotlin-classes/debug/com/rnalarmmodule/AlarmPackage.class +0 -0
  125. package/android/build/tmp/kotlin-classes/debug/com/rnalarmmodule/AlarmReceiver$Companion.class +0 -0
  126. package/android/build/tmp/kotlin-classes/debug/com/rnalarmmodule/AlarmReceiver.class +0 -0
  127. package/android/build/tmp/kotlin-classes/debug/com/rnalarmmodule/BootReceiver$Companion.class +0 -0
  128. package/android/build/tmp/kotlin-classes/debug/com/rnalarmmodule/BootReceiver.class +0 -0
  129. package/android/build.gradle +11 -21
  130. package/android/src/main/AndroidManifest.xml +16 -35
  131. package/android/src/main/java/com/rnalarmmodule/AlarmModule.kt +163 -387
  132. package/android/src/main/java/com/rnalarmmodule/AlarmPackage.kt +0 -1
  133. package/android/src/main/java/com/rnalarmmodule/AlarmReceiver.kt +300 -129
  134. package/android/src/main/java/com/rnalarmmodule/BootReceiver.kt +66 -124
  135. package/android/src/main/res/raw/alarm_default.wav +0 -0
  136. package/ios/{RNAlarmModule.m → AlarmModule.m} +9 -20
  137. package/ios/AlarmModule.swift +241 -36
  138. package/ios/RNAlarmModule-Bridging-Header.h +5 -1
  139. package/lib/index.d.ts +51 -85
  140. package/lib/index.d.ts.map +1 -1
  141. package/lib/index.js +60 -120
  142. package/lib/index.js.map +1 -1
  143. package/package.json +14 -23
  144. package/react-native-alarmageddon.podspec +10 -8
  145. package/react-native.config.js +3 -1
  146. package/src/index.ts +98 -201
  147. package/android/gradle.properties +0 -13
  148. package/android/src/main/java/com/rnalarmmodule/AlarmActivity.kt +0 -79
  149. package/android/src/main/java/com/rnalarmmodule/AlarmService.kt +0 -290
  150. package/android/src/main/res/raw/README.md +0 -36
package/lib/index.d.ts CHANGED
@@ -1,147 +1,113 @@
1
- import { EmitterSubscription } from 'react-native';
2
1
  /**
3
2
  * Parameters for scheduling an alarm
4
3
  */
5
4
  export type AlarmParams = {
6
5
  /** Unique identifier for the alarm */
7
6
  id: string;
8
- /** ISO 8601 datetime string for when the alarm should trigger */
7
+ /** ISO 8601 timestamp for when the alarm should trigger (e.g., "2025-11-10T08:30:00") */
9
8
  datetimeISO: string;
10
- /** Title shown in the notification */
9
+ /** Title to display in the notification */
11
10
  title?: string;
12
- /** Body text shown in the notification */
11
+ /** Body text to display in the notification */
13
12
  body?: string;
14
- /** URI of the sound to play (uses default alarm sound if not provided) */
15
- soundUri?: string;
16
- /** Whether to vibrate when alarm triggers (default: true) */
17
- vibrate?: boolean;
18
- /** Number of minutes for snooze (default: 5) */
19
- snoozeMinutes?: number;
20
- /** Number of seconds before alarm auto-stops (default: 60) */
21
- autoStopSeconds?: number;
13
+ /** Whether snoozing is enabled for this alarm */
14
+ snoozeEnabled?: boolean;
15
+ /** Interval in minutes for snoozing */
16
+ snoozeInterval?: number;
22
17
  };
23
18
  /**
24
- * Stored alarm data returned from listAlarms
25
- */
26
- export type StoredAlarm = {
27
- id: string;
28
- datetimeISO: string;
29
- title: string;
30
- body: string;
31
- vibrate: boolean;
32
- snoozeMinutes: number;
33
- autoStopSeconds: number;
34
- };
35
- /**
36
- * Permission request result
19
+ * Result of permission request
37
20
  */
38
21
  export type PermissionResult = {
39
22
  granted: boolean;
40
- exactAlarmGranted?: boolean;
41
23
  };
42
24
  /**
43
- * Active alarm info
25
+ * Active alarm state
44
26
  */
45
- export type ActiveAlarmInfo = {
27
+ export type ActiveAlarmState = {
46
28
  activeAlarmId: string;
47
29
  } | null;
48
30
  /**
49
- * Request notification permission (required on Android 13+)
50
- * @returns Promise resolving to true if permission granted
51
- */
52
- declare function requestNotificationPermission(): Promise<boolean>;
53
- /**
54
- * Request exact alarm permission (required on Android 12+)
55
- * Opens system settings if not granted
56
- * @returns Promise resolving to permission result
57
- */
58
- declare function requestExactAlarmPermission(): Promise<PermissionResult>;
59
- /**
60
- * Check if exact alarm permission is granted
61
- * @returns Promise resolving to true if permission granted
31
+ * Subscription type for event listeners
62
32
  */
63
- declare function checkExactAlarmPermission(): Promise<boolean>;
33
+ export type AlarmSubscription = {
34
+ remove: () => void;
35
+ };
64
36
  /**
65
- * Open system settings for exact alarm permission
37
+ * Callback type for alarm state changes
66
38
  */
67
- declare function openExactAlarmSettings(): Promise<void>;
39
+ export type AlarmStateCallback = (alarmId: string | null) => void;
68
40
  /**
69
- * Ensure all required permissions are granted
70
- * Requests both notification and exact alarm permissions
71
- * @returns Promise resolving to true if all permissions granted
41
+ * Ensures notification permissions are granted.
42
+ * On Android 13+, this will request POST_NOTIFICATIONS permission.
43
+ * @returns Promise resolving to true if permissions are granted
72
44
  */
73
45
  declare function ensurePermissions(): Promise<boolean>;
74
46
  /**
75
- * Schedule an alarm
76
- * @param alarm - Alarm parameters
47
+ * Schedule an alarm to trigger at a specific time.
48
+ * The alarm will persist through device reboots.
49
+ * @param alarm - Alarm parameters including id, datetime, title, and body
77
50
  */
78
51
  declare function scheduleAlarm(alarm: AlarmParams): Promise<void>;
79
52
  /**
80
- * Cancel a scheduled alarm
81
- * @param id - Alarm ID to cancel
53
+ * Cancel a scheduled alarm by its ID.
54
+ * @param id - The unique identifier of the alarm to cancel
82
55
  */
83
56
  declare function cancelAlarm(id: string): Promise<void>;
84
57
  /**
85
- * List all scheduled alarms
86
- * @returns Promise resolving to array of stored alarms
58
+ * List all currently scheduled alarms.
59
+ * @returns Promise resolving to an array of alarm parameters
87
60
  */
88
- declare function listAlarms(): Promise<StoredAlarm[]>;
61
+ declare function listAlarms(): Promise<AlarmParams[]>;
89
62
  /**
90
- * Snooze an alarm for a specified number of minutes
91
- * @param id - Alarm ID to snooze
92
- * @param minutes - Number of minutes to snooze (default: 5)
63
+ * Request alarm and notification permissions.
64
+ * @returns Promise resolving to permission result
93
65
  */
94
- declare function snoozeAlarm(id: string, minutes?: number): Promise<void>;
66
+ declare function requestPermissions(): Promise<PermissionResult>;
95
67
  /**
96
- * Stop the currently playing alarm
97
- * @param id - Alarm ID to stop
68
+ * Snooze an alarm by scheduling a new one for the specified minutes.
69
+ * @param id - The alarm ID (used for the new snoozed alarm)
70
+ * @param minutes - Number of minutes to snooze
98
71
  */
99
- declare function stopCurrentAlarm(id: string): Promise<void>;
72
+ declare function snoozeAlarm(id: string, minutes: number): Promise<void>;
100
73
  /**
101
- * Snooze the currently playing alarm
102
- * @param id - Alarm ID to snooze
103
- * @param minutes - Number of minutes to snooze (default: 5)
74
+ * Stop the currently ringing alarm.
75
+ * @param id - The ID of the alarm to stop
104
76
  */
105
- declare function snoozeCurrentAlarm(id: string, minutes?: number): Promise<void>;
77
+ declare function stopCurrentAlarm(id: string): Promise<void>;
106
78
  /**
107
- * Get the currently playing alarm (if any)
108
- * @returns Promise resolving to active alarm info or null
79
+ * Snooze the currently ringing alarm.
80
+ * @param id - The ID of the alarm to snooze
81
+ * @param minutes - Number of minutes to snooze
109
82
  */
110
- declare function getCurrentAlarmPlaying(): Promise<ActiveAlarmInfo>;
83
+ declare function snoozeCurrentAlarm(id: string, minutes: number): Promise<void>;
111
84
  /**
112
- * Subscribe to alarm state changes
113
- * Callback receives the alarm ID when an alarm starts, or null when stopped
114
- * @param callback - Function called when alarm state changes
115
- * @returns Cleanup function to remove the subscription
85
+ * Get the currently playing alarm, if any.
86
+ * @returns Promise resolving to the active alarm state or null
116
87
  */
117
- declare function onAlarmStateChange(callback: (alarmId: string | null) => void): () => void;
88
+ declare function getCurrentAlarmPlaying(): Promise<ActiveAlarmState>;
118
89
  /**
119
- * Add event listener for alarm state changes
120
- * @param event - Event name ('activeAlarmId')
121
- * @param callback - Callback function
122
- * @returns EmitterSubscription for removal
90
+ * Subscribe to alarm state changes.
91
+ * The callback will be invoked when an alarm starts or stops ringing.
92
+ * @param callback - Function called with the alarm ID (or null when stopped)
93
+ * @returns Subscription object with remove() method to unsubscribe
123
94
  */
124
- declare function addEventListener(event: 'activeAlarmId', callback: (alarmId: string | null) => void): EmitterSubscription;
95
+ declare function onAlarmStateChange(callback: AlarmStateCallback): AlarmSubscription;
125
96
  /**
126
- * Main module export with all alarm functions
97
+ * React Native Alarmageddon - Native exact alarm scheduling
127
98
  */
128
99
  declare const RNAlarmModule: {
129
100
  ensurePermissions: typeof ensurePermissions;
130
- requestNotificationPermission: typeof requestNotificationPermission;
131
- requestExactAlarmPermission: typeof requestExactAlarmPermission;
132
- checkExactAlarmPermission: typeof checkExactAlarmPermission;
133
- openExactAlarmSettings: typeof openExactAlarmSettings;
134
101
  scheduleAlarm: typeof scheduleAlarm;
135
102
  cancelAlarm: typeof cancelAlarm;
136
103
  listAlarms: typeof listAlarms;
104
+ requestPermissions: typeof requestPermissions;
137
105
  snoozeAlarm: typeof snoozeAlarm;
138
106
  stopCurrentAlarm: typeof stopCurrentAlarm;
139
107
  snoozeCurrentAlarm: typeof snoozeCurrentAlarm;
140
108
  getCurrentAlarmPlaying: typeof getCurrentAlarmPlaying;
141
109
  onAlarmStateChange: typeof onAlarmStateChange;
142
- addEventListener: typeof addEventListener;
143
110
  };
144
111
  export default RNAlarmModule;
145
112
  export { RNAlarmModule };
146
- export { ensurePermissions, requestNotificationPermission, requestExactAlarmPermission, checkExactAlarmPermission, openExactAlarmSettings, scheduleAlarm, cancelAlarm, listAlarms, snoozeAlarm, stopCurrentAlarm, snoozeCurrentAlarm, getCurrentAlarmPlaying, onAlarmStateChange, addEventListener, };
147
113
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAEtB;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,iEAAiE;IACjE,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAE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I,OAAO,CAAC,gBAAgB,CAAC,CAEjE;AAED;;;;;GAKG;AACH,iBAAS,kBAAkB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,iBAAiB,CAK3E;AAED;;GAEG;AACH,QAAA,MAAM,aAAa;;;;;;;;;;;CAWlB,CAAC;AAEF,eAAe,aAAa,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,CAAC"}
package/lib/index.js CHANGED
@@ -1,189 +1,129 @@
1
- import { NativeModules, NativeEventEmitter, PermissionsAndroid, Platform, } from 'react-native';
2
- const { AlarmModule } = NativeModules;
3
- // Validate module exists
4
- if (!AlarmModule) {
5
- throw new Error('react-native-alarmageddon: NativeModule is null. ' +
6
- 'Ensure you have linked the native module correctly. ' +
7
- 'On Android, run `npx react-native run-android` to rebuild.');
8
- }
1
+ import { NativeModules, NativeEventEmitter, Platform, PermissionsAndroid, } from 'react-native';
2
+ const LINKING_ERROR = `The package 'react-native-alarmageddon' doesn't seem to be linked. Make sure: \n\n` +
3
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
4
+ '- You rebuilt the app after installing the package\n' +
5
+ '- You are not using Expo Go (Expo managed workflow is not supported)\n';
6
+ const AlarmModule = NativeModules.AlarmModule
7
+ ? NativeModules.AlarmModule
8
+ : new Proxy({}, {
9
+ get() {
10
+ throw new Error(LINKING_ERROR);
11
+ },
12
+ });
9
13
  const eventEmitter = new NativeEventEmitter(NativeModules.AlarmModule);
10
14
  /**
11
- * Request notification permission (required on Android 13+)
12
- * @returns Promise resolving to true if permission granted
15
+ * Ensures notification permissions are granted.
16
+ * On Android 13+, this will request POST_NOTIFICATIONS permission.
17
+ * @returns Promise resolving to true if permissions are granted
13
18
  */
14
- async function requestNotificationPermission() {
19
+ async function ensurePermissions() {
15
20
  if (Platform.OS !== 'android') {
21
+ // iOS implementation pending
16
22
  return true;
17
23
  }
18
24
  try {
25
+ const status = await AlarmModule.requestPermissions();
26
+ if (status.granted) {
27
+ return true;
28
+ }
29
+ // Android 13+ requires explicit POST_NOTIFICATIONS permission
19
30
  if (Platform.Version >= 33) {
20
- const status = await PermissionsAndroid.request('android.permission.POST_NOTIFICATIONS');
21
- return status === PermissionsAndroid.RESULTS.GRANTED;
31
+ const result = await PermissionsAndroid.request('android.permission.POST_NOTIFICATIONS');
32
+ return result === PermissionsAndroid.RESULTS.GRANTED;
22
33
  }
23
34
  return true;
24
35
  }
25
36
  catch (error) {
26
- console.warn('Failed to request notification permission:', error);
37
+ console.warn('react-native-alarmageddon: Failed to request permissions', error);
27
38
  return false;
28
39
  }
29
40
  }
30
41
  /**
31
- * Request exact alarm permission (required on Android 12+)
32
- * Opens system settings if not granted
33
- * @returns Promise resolving to permission result
34
- */
35
- async function requestExactAlarmPermission() {
36
- if (Platform.OS !== 'android') {
37
- return { granted: true, exactAlarmGranted: true };
38
- }
39
- return AlarmModule.requestPermissions();
40
- }
41
- /**
42
- * Check if exact alarm permission is granted
43
- * @returns Promise resolving to true if permission granted
44
- */
45
- async function checkExactAlarmPermission() {
46
- if (Platform.OS !== 'android') {
47
- return true;
48
- }
49
- return AlarmModule.checkExactAlarmPermission();
50
- }
51
- /**
52
- * Open system settings for exact alarm permission
53
- */
54
- async function openExactAlarmSettings() {
55
- if (Platform.OS === 'android') {
56
- return AlarmModule.openExactAlarmSettings();
57
- }
58
- }
59
- /**
60
- * Ensure all required permissions are granted
61
- * Requests both notification and exact alarm permissions
62
- * @returns Promise resolving to true if all permissions granted
63
- */
64
- async function ensurePermissions() {
65
- if (Platform.OS !== 'android') {
66
- return true;
67
- }
68
- const [notificationGranted, exactAlarmResult] = await Promise.all([
69
- requestNotificationPermission(),
70
- requestExactAlarmPermission(),
71
- ]);
72
- return notificationGranted && exactAlarmResult.granted;
73
- }
74
- /**
75
- * Schedule an alarm
76
- * @param alarm - Alarm parameters
42
+ * Schedule an alarm to trigger at a specific time.
43
+ * The alarm will persist through device reboots.
44
+ * @param alarm - Alarm parameters including id, datetime, title, and body
77
45
  */
78
46
  async function scheduleAlarm(alarm) {
79
- if (!alarm.id) {
80
- throw new Error('Alarm ID is required');
81
- }
82
- if (!alarm.datetimeISO) {
83
- throw new Error('datetimeISO is required');
84
- }
85
47
  return AlarmModule.scheduleAlarm(alarm);
86
48
  }
87
49
  /**
88
- * Cancel a scheduled alarm
89
- * @param id - Alarm ID to cancel
50
+ * Cancel a scheduled alarm by its ID.
51
+ * @param id - The unique identifier of the alarm to cancel
90
52
  */
91
53
  async function cancelAlarm(id) {
92
- if (!id) {
93
- throw new Error('Alarm ID is required');
94
- }
95
54
  return AlarmModule.cancelAlarm(id);
96
55
  }
97
56
  /**
98
- * List all scheduled alarms
99
- * @returns Promise resolving to array of stored alarms
57
+ * List all currently scheduled alarms.
58
+ * @returns Promise resolving to an array of alarm parameters
100
59
  */
101
60
  async function listAlarms() {
102
61
  return AlarmModule.listAlarms();
103
62
  }
104
63
  /**
105
- * Snooze an alarm for a specified number of minutes
106
- * @param id - Alarm ID to snooze
107
- * @param minutes - Number of minutes to snooze (default: 5)
64
+ * Request alarm and notification permissions.
65
+ * @returns Promise resolving to permission result
66
+ */
67
+ async function requestPermissions() {
68
+ return AlarmModule.requestPermissions();
69
+ }
70
+ /**
71
+ * Snooze an alarm by scheduling a new one for the specified minutes.
72
+ * @param id - The alarm ID (used for the new snoozed alarm)
73
+ * @param minutes - Number of minutes to snooze
108
74
  */
109
- async function snoozeAlarm(id, minutes = 5) {
110
- if (!id) {
111
- throw new Error('Alarm ID is required');
112
- }
75
+ async function snoozeAlarm(id, minutes) {
113
76
  return AlarmModule.snoozeAlarm(id, minutes);
114
77
  }
115
78
  /**
116
- * Stop the currently playing alarm
117
- * @param id - Alarm ID to stop
79
+ * Stop the currently ringing alarm.
80
+ * @param id - The ID of the alarm to stop
118
81
  */
119
82
  async function stopCurrentAlarm(id) {
120
- if (!id) {
121
- throw new Error('Alarm ID is required');
122
- }
123
83
  return AlarmModule.stopCurrentAlarm(id);
124
84
  }
125
85
  /**
126
- * Snooze the currently playing alarm
127
- * @param id - Alarm ID to snooze
128
- * @param minutes - Number of minutes to snooze (default: 5)
86
+ * Snooze the currently ringing alarm.
87
+ * @param id - The ID of the alarm to snooze
88
+ * @param minutes - Number of minutes to snooze
129
89
  */
130
- async function snoozeCurrentAlarm(id, minutes = 5) {
131
- if (!id) {
132
- throw new Error('Alarm ID is required');
133
- }
90
+ async function snoozeCurrentAlarm(id, minutes) {
134
91
  return AlarmModule.snoozeCurrentAlarm(id, minutes);
135
92
  }
136
93
  /**
137
- * Get the currently playing alarm (if any)
138
- * @returns Promise resolving to active alarm info or null
94
+ * Get the currently playing alarm, if any.
95
+ * @returns Promise resolving to the active alarm state or null
139
96
  */
140
97
  async function getCurrentAlarmPlaying() {
141
98
  return AlarmModule.getCurrentAlarmPlaying();
142
99
  }
143
100
  /**
144
- * Subscribe to alarm state changes
145
- * Callback receives the alarm ID when an alarm starts, or null when stopped
146
- * @param callback - Function called when alarm state changes
147
- * @returns Cleanup function to remove the subscription
101
+ * Subscribe to alarm state changes.
102
+ * The callback will be invoked when an alarm starts or stops ringing.
103
+ * @param callback - Function called with the alarm ID (or null when stopped)
104
+ * @returns Subscription object with remove() method to unsubscribe
148
105
  */
149
106
  function onAlarmStateChange(callback) {
150
107
  const subscription = eventEmitter.addListener('activeAlarmId', callback);
151
- return () => subscription.remove();
152
- }
153
- /**
154
- * Add event listener for alarm state changes
155
- * @param event - Event name ('activeAlarmId')
156
- * @param callback - Callback function
157
- * @returns EmitterSubscription for removal
158
- */
159
- function addEventListener(event, callback) {
160
- return eventEmitter.addListener(event, callback);
108
+ return {
109
+ remove: () => subscription.remove(),
110
+ };
161
111
  }
162
112
  /**
163
- * Main module export with all alarm functions
113
+ * React Native Alarmageddon - Native exact alarm scheduling
164
114
  */
165
115
  const RNAlarmModule = {
166
- // Permissions
167
116
  ensurePermissions,
168
- requestNotificationPermission,
169
- requestExactAlarmPermission,
170
- checkExactAlarmPermission,
171
- openExactAlarmSettings,
172
- // Alarm management
173
117
  scheduleAlarm,
174
118
  cancelAlarm,
175
119
  listAlarms,
120
+ requestPermissions,
176
121
  snoozeAlarm,
177
- // Active alarm control
178
122
  stopCurrentAlarm,
179
123
  snoozeCurrentAlarm,
180
124
  getCurrentAlarmPlaying,
181
- // Event handling
182
125
  onAlarmStateChange,
183
- addEventListener,
184
126
  };
185
127
  export default RNAlarmModule;
186
128
  export { RNAlarmModule };
187
- // Export individual functions for tree-shaking
188
- export { ensurePermissions, requestNotificationPermission, requestExactAlarmPermission, checkExactAlarmPermission, openExactAlarmSettings, scheduleAlarm, cancelAlarm, listAlarms, snoozeAlarm, stopCurrentAlarm, snoozeCurrentAlarm, getCurrentAlarmPlaying, onAlarmStateChange, addEventListener, };
189
129
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,QAAQ,GAET,MAAM,cAAc,CAAC;AAsEtB,MAAM,EAAE,WAAW,EAAE,GAAG,aAAsD,CAAC;AAE/E,yBAAyB;AACzB,IAAI,CAAC,WAAW,EAAE,CAAC;IACjB,MAAM,IAAI,KAAK,CACb,mDAAmD;QACjD,sDAAsD;QACtD,4DAA4D,CAC/D,CAAC;AACJ,CAAC;AAED,MAAM,YAAY,GAAG,IAAI,kBAAkB,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;AAEvE;;;GAGG;AACH,KAAK,UAAU,6BAA6B;IAC1C,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,IAAI,QAAQ,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAC7C,uCAA8C,CAC/C,CAAC;YACF,OAAO,MAAM,KAAK,kBAAkB,CAAC,O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AC7B,OAAO,EAAE,aAAa,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-alarmageddon",
3
- "version": "1.1.1",
3
+ "version": "2.1.0",
4
4
  "description": "Native exact alarm scheduling for React Native with sound, snooze, and boot persistence",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.js",
@@ -19,9 +19,7 @@
19
19
  "scripts": {
20
20
  "build": "tsc",
21
21
  "prepare": "npm run build",
22
- "prepublishOnly": "npm run build",
23
- "clean": "rm -rf lib/",
24
- "typecheck": "tsc --noEmit"
22
+ "prepublishOnly": "npm run build"
25
23
  },
26
24
  "keywords": [
27
25
  "react-native",
@@ -30,34 +28,27 @@
30
28
  "notification",
31
29
  "android",
32
30
  "exact-alarm",
33
- "wake-alarm",
34
- "snooze",
35
- "boot-persistence",
36
- "alarmmanager",
37
- "foreground-service"
31
+ "wakeup",
32
+ "timer",
33
+ "reminder"
38
34
  ],
39
- "author": "",
35
+ "author": "Alameda Apps",
40
36
  "license": "MIT",
41
37
  "repository": {
42
38
  "type": "git",
43
- "url": "https://github.com/user/react-native-alarmageddon.git"
39
+ "url": "https://github.com/alamedapps/react-native-alarmageddon.git"
44
40
  },
45
41
  "bugs": {
46
- "url": "https://github.com/user/react-native-alarmageddon/issues"
42
+ "url": "https://github.com/alamedapps/react-native-alarmageddon/issues"
47
43
  },
48
- "homepage": "https://github.com/user/react-native-alarmageddon#readme",
44
+ "homepage": "https://github.com/alamedapps/react-native-alarmageddon#readme",
49
45
  "peerDependencies": {
50
- "react": ">=19.0.0",
51
- "react-native": ">=0.73.0"
46
+ "react": ">=16.8.0",
47
+ "react-native": ">=0.60.0"
52
48
  },
53
49
  "devDependencies": {
54
- "@types/react": "^19.2.9",
55
- "@types/react-native": "^0.73.0",
56
- "react": "^19.2.3",
57
- "react-native": "^0.83.1",
58
- "typescript": "^5.3.0"
59
- },
60
- "engines": {
61
- "node": ">=16.0.0"
50
+ "@types/react": "^18.0.0",
51
+ "@types/react-native": "^0.72.0",
52
+ "typescript": "^5.0.0"
62
53
  }
63
54
  }
@@ -10,16 +10,18 @@ Pod::Spec.new do |s|
10
10
  s.license = package["license"]
11
11
  s.authors = package["author"]
12
12
 
13
- s.platforms = { :ios => "11.0" }
14
- s.source = { :git => "https://github.com/user/react-native-alarmageddon.git", :tag => "#{s.version}" }
13
+ s.platforms = { :ios => "13.0" }
14
+ s.source = { :git => "https://github.com/alamedapps/react-native-alarmageddon.git", :tag => "#{s.version}" }
15
15
 
16
16
  s.source_files = "ios/**/*.{h,m,mm,swift}"
17
17
 
18
- s.dependency "React-Core"
18
+ s.swift_version = "5.0"
19
19
 
20
- # Swift/Objective-C bridging
21
- s.pod_target_xcconfig = {
22
- "DEFINES_MODULE" => "YES",
23
- "SWIFT_OBJC_BRIDGING_HEADER" => "$(PODS_TARGET_SRCROOT)/ios/AlarmModule-Bridging-Header.h"
24
- }
20
+ # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
21
+ # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795uj8711ac8f7bab/scripts/cocoapods/new_architecture.rb#L79.
22
+ if respond_to?(:install_modules_dependencies, true)
23
+ install_modules_dependencies(s)
24
+ else
25
+ s.dependency "React-Core"
26
+ end
25
27
  end
@@ -6,7 +6,9 @@ module.exports = {
6
6
  packageImportPath: 'import com.rnalarmmodule.AlarmPackage;',
7
7
  packageInstance: 'new AlarmPackage()',
8
8
  },
9
- ios: null, // iOS stub - not implemented yet
9
+ ios: {
10
+ podspecPath: './react-native-alarmageddon.podspec',
11
+ },
10
12
  },
11
13
  },
12
14
  };