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.
- package/LICENSE +1 -1
- package/README.md +169 -187
- package/android/build/.transforms/33d69af0aa8d226a34981fd71aab63e2/results.bin +1 -0
- package/android/build/.transforms/33d69af0aa8d226a34981fd71aab63e2/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/4aeb440f8cdf777de34ab1099140d239/results.bin +1 -0
- package/android/build/.transforms/4aeb440f8cdf777de34ab1099140d239/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/com/rnalarmmodule/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +41 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +1 -0
- package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_alarm_default.wav.flat +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +2 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/react-native-alarmageddon_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/rnalarmmodule/BuildConfig.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +3 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +68 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +41 -0
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/alarm_default.wav +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +2 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +71 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-alarmageddon_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/rnalarmmodule/AlarmModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/rnalarmmodule/AlarmModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/rnalarmmodule/AlarmPackage.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/rnalarmmodule/AlarmReceiver$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/rnalarmmodule/AlarmReceiver.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/rnalarmmodule/BootReceiver$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/rnalarmmodule/BootReceiver.class +0 -0
- package/android/build.gradle +11 -21
- package/android/src/main/AndroidManifest.xml +16 -35
- package/android/src/main/java/com/rnalarmmodule/AlarmModule.kt +163 -387
- package/android/src/main/java/com/rnalarmmodule/AlarmPackage.kt +0 -1
- package/android/src/main/java/com/rnalarmmodule/AlarmReceiver.kt +300 -129
- package/android/src/main/java/com/rnalarmmodule/BootReceiver.kt +66 -124
- package/android/src/main/res/raw/alarm_default.wav +0 -0
- package/ios/{RNAlarmModule.m → AlarmModule.m} +9 -20
- package/ios/AlarmModule.swift +241 -36
- package/ios/RNAlarmModule-Bridging-Header.h +5 -1
- package/lib/index.d.ts +51 -85
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +60 -120
- package/lib/index.js.map +1 -1
- package/package.json +14 -23
- package/react-native-alarmageddon.podspec +10 -8
- package/react-native.config.js +3 -1
- package/src/index.ts +98 -201
- package/android/gradle.properties +0 -13
- package/android/src/main/java/com/rnalarmmodule/AlarmActivity.kt +0 -79
- package/android/src/main/java/com/rnalarmmodule/AlarmService.kt +0 -290
- 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
|
|
7
|
+
/** ISO 8601 timestamp for when the alarm should trigger (e.g., "2025-11-10T08:30:00") */
|
|
9
8
|
datetimeISO: string;
|
|
10
|
-
/** Title
|
|
9
|
+
/** Title to display in the notification */
|
|
11
10
|
title?: string;
|
|
12
|
-
/** Body text
|
|
11
|
+
/** Body text to display in the notification */
|
|
13
12
|
body?: string;
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
|
|
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
|
-
*
|
|
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
|
|
25
|
+
* Active alarm state
|
|
44
26
|
*/
|
|
45
|
-
export type
|
|
27
|
+
export type ActiveAlarmState = {
|
|
46
28
|
activeAlarmId: string;
|
|
47
29
|
} | null;
|
|
48
30
|
/**
|
|
49
|
-
*
|
|
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
|
-
|
|
33
|
+
export type AlarmSubscription = {
|
|
34
|
+
remove: () => void;
|
|
35
|
+
};
|
|
64
36
|
/**
|
|
65
|
-
*
|
|
37
|
+
* Callback type for alarm state changes
|
|
66
38
|
*/
|
|
67
|
-
|
|
39
|
+
export type AlarmStateCallback = (alarmId: string | null) => void;
|
|
68
40
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* @returns Promise resolving to true if
|
|
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
|
-
*
|
|
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 -
|
|
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
|
|
58
|
+
* List all currently scheduled alarms.
|
|
59
|
+
* @returns Promise resolving to an array of alarm parameters
|
|
87
60
|
*/
|
|
88
|
-
declare function listAlarms(): Promise<
|
|
61
|
+
declare function listAlarms(): Promise<AlarmParams[]>;
|
|
89
62
|
/**
|
|
90
|
-
*
|
|
91
|
-
* @
|
|
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
|
|
66
|
+
declare function requestPermissions(): Promise<PermissionResult>;
|
|
95
67
|
/**
|
|
96
|
-
*
|
|
97
|
-
* @param id -
|
|
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
|
|
72
|
+
declare function snoozeAlarm(id: string, minutes: number): Promise<void>;
|
|
100
73
|
/**
|
|
101
|
-
*
|
|
102
|
-
* @param id -
|
|
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
|
|
77
|
+
declare function stopCurrentAlarm(id: string): Promise<void>;
|
|
106
78
|
/**
|
|
107
|
-
*
|
|
108
|
-
* @
|
|
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
|
|
83
|
+
declare function snoozeCurrentAlarm(id: string, minutes: number): Promise<void>;
|
|
111
84
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
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
|
|
88
|
+
declare function getCurrentAlarmPlaying(): Promise<ActiveAlarmState>;
|
|
118
89
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
* @param callback -
|
|
122
|
-
* @returns
|
|
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
|
|
95
|
+
declare function onAlarmStateChange(callback: AlarmStateCallback): AlarmSubscription;
|
|
125
96
|
/**
|
|
126
|
-
*
|
|
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
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,sCAAsC;IACtC,E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EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzD;AAED;;;;GAIG;AACH,iBAAe,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5E;AAED;;;GAGG;AACH,iBAAe,sBAAsB,IAAI,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,
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
*
|
|
12
|
-
*
|
|
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
|
|
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
|
|
21
|
-
return
|
|
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
|
|
37
|
+
console.warn('react-native-alarmageddon: Failed to request permissions', error);
|
|
27
38
|
return false;
|
|
28
39
|
}
|
|
29
40
|
}
|
|
30
41
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @
|
|
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 -
|
|
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
|
|
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
|
-
*
|
|
106
|
-
* @
|
|
107
|
-
|
|
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
|
|
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
|
|
117
|
-
* @param id -
|
|
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
|
|
127
|
-
* @param id -
|
|
128
|
-
* @param minutes - Number of minutes to snooze
|
|
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
|
|
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
|
|
138
|
-
* @returns Promise resolving to active alarm
|
|
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
|
-
*
|
|
146
|
-
* @param callback - Function called
|
|
147
|
-
* @returns
|
|
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
|
|
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
|
-
*
|
|
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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAgDtB,MAAM,aAAa,GACjB,oFAAoF;IACpF,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,gCAAgC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACvE,sDAAsD;IACtD,wEAAwE,CAAC;AAE3E,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-
"version": "
|
|
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
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
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/
|
|
39
|
+
"url": "https://github.com/alamedapps/react-native-alarmageddon.git"
|
|
44
40
|
},
|
|
45
41
|
"bugs": {
|
|
46
|
-
"url": "https://github.com/
|
|
42
|
+
"url": "https://github.com/alamedapps/react-native-alarmageddon/issues"
|
|
47
43
|
},
|
|
48
|
-
"homepage": "https://github.com/
|
|
44
|
+
"homepage": "https://github.com/alamedapps/react-native-alarmageddon#readme",
|
|
49
45
|
"peerDependencies": {
|
|
50
|
-
"react": ">=
|
|
51
|
-
"react-native": ">=0.
|
|
46
|
+
"react": ">=16.8.0",
|
|
47
|
+
"react-native": ">=0.60.0"
|
|
52
48
|
},
|
|
53
49
|
"devDependencies": {
|
|
54
|
-
"@types/react": "^
|
|
55
|
-
"@types/react-native": "^0.
|
|
56
|
-
"
|
|
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 => "
|
|
14
|
-
s.source = { :git => "https://github.com/
|
|
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.
|
|
18
|
+
s.swift_version = "5.0"
|
|
19
19
|
|
|
20
|
-
#
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
package/react-native.config.js
CHANGED
|
@@ -6,7 +6,9 @@ module.exports = {
|
|
|
6
6
|
packageImportPath: 'import com.rnalarmmodule.AlarmPackage;',
|
|
7
7
|
packageInstance: 'new AlarmPackage()',
|
|
8
8
|
},
|
|
9
|
-
ios:
|
|
9
|
+
ios: {
|
|
10
|
+
podspecPath: './react-native-alarmageddon.podspec',
|
|
11
|
+
},
|
|
10
12
|
},
|
|
11
13
|
},
|
|
12
14
|
};
|