react-native-alarms 0.0.2 → 0.0.4
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/README.md +71 -2
- package/android-lib/build.gradle +36 -0
- package/android-lib/src/main/AndroidManifest.xml +49 -0
- package/android-lib/src/main/java/com/reactnativealarms/RNAlarmsPackage.kt +18 -0
- package/android-lib/src/main/res/values/styles.xml +3 -0
- package/index.d.ts +6 -6
- package/index.ts +1 -2
- package/ios/.xcode.env.local +1 -0
- package/ios/ReactNativeAlarm.xcodeproj/project.pbxproj +4 -0
- package/ios/alarm/AlarmModule.m +25 -0
- package/ios/alarm/AlarmModule.swift +19 -2
- package/ios/alarm/AlarmRingPresenter.swift +108 -0
- package/ios/alarm/NotificationBackend.swift +36 -7
- package/package.json +7 -20
- package/react-native-alarms.podspec +20 -0
- package/react-native.config.js +16 -0
- package/specs/NativeAlarm.ts +20 -2
- package/app.json +0 -4
- package/index.js +0 -12
- package/ios/Podfile.lock +0 -2179
package/specs/NativeAlarm.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TurboModule } from 'react-native';
|
|
2
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
2
|
+
import { NativeModules, Platform, TurboModuleRegistry } from 'react-native';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Shared contract of the native `Alarm` module.
|
|
@@ -92,4 +92,22 @@ export interface Spec extends TurboModule {
|
|
|
92
92
|
removeListeners(count: number): void;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
const LINKING_ERROR =
|
|
96
|
+
"react-native-alarms: the native 'Alarm' module is not linked. " +
|
|
97
|
+
Platform.select({
|
|
98
|
+
ios: "Run 'pod install' in the ios folder, then rebuild the app.",
|
|
99
|
+
default: 'Rebuild the app after installing the package.',
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// Both platforms register a legacy module, reachable through either registry
|
|
103
|
+
// depending on the architecture. Throw on first use, not on import.
|
|
104
|
+
const Alarm: Spec =
|
|
105
|
+
TurboModuleRegistry.get<Spec>('Alarm') ??
|
|
106
|
+
NativeModules.Alarm ??
|
|
107
|
+
new Proxy({} as Spec, {
|
|
108
|
+
get() {
|
|
109
|
+
throw new Error(LINKING_ERROR);
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
export default Alarm;
|
package/app.json
DELETED
package/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @format
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { AppRegistry } from 'react-native';
|
|
6
|
-
import App from './App';
|
|
7
|
-
import { name as appName } from './app.json';
|
|
8
|
-
import { AlarmRingScreen } from './AlarmRingScreen';
|
|
9
|
-
|
|
10
|
-
AppRegistry.registerComponent(appName, () => App);
|
|
11
|
-
|
|
12
|
-
AppRegistry.registerComponent('AlarmRing', () => AlarmRingScreen);
|