react-native-alarms 0.0.0-stage → 0.0.1
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/.bundle/config +2 -0
- package/.eslintrc.js +4 -0
- package/.prettierrc.js +5 -0
- package/.watchmanconfig +1 -0
- package/AlarmDemo.tsx +223 -0
- package/AlarmRingScreen.tsx +117 -0
- package/App.tsx +14 -0
- package/Gemfile +17 -0
- package/Gemfile.lock +114 -0
- package/README.md +96 -2
- package/__tests__/App.test.tsx +13 -0
- package/android/app/build.gradle +119 -0
- package/android/app/debug.keystore +0 -0
- package/android/app/proguard-rules.pro +10 -0
- package/android/app/src/main/AndroidManifest.xml +81 -0
- package/android/app/src/main/java/com/reactnativealarm/MainActivity.kt +29 -0
- package/android/app/src/main/java/com/reactnativealarm/MainApplication.kt +29 -0
- package/android/app/src/main/java/com/reactnativealarm/alarm/AlarmData.kt +134 -0
- package/android/app/src/main/java/com/reactnativealarm/alarm/AlarmModule.kt +263 -0
- package/android/app/src/main/java/com/reactnativealarm/alarm/AlarmPackage.kt +24 -0
- package/android/app/src/main/java/com/reactnativealarm/alarm/AlarmReceiver.kt +43 -0
- package/android/app/src/main/java/com/reactnativealarm/alarm/AlarmRingActivity.kt +86 -0
- package/android/app/src/main/java/com/reactnativealarm/alarm/AlarmScheduler.kt +74 -0
- package/android/app/src/main/java/com/reactnativealarm/alarm/AlarmService.kt +285 -0
- package/android/app/src/main/java/com/reactnativealarm/alarm/AlarmStore.kt +13 -0
- package/android/app/src/main/java/com/reactnativealarm/alarm/BootReceiver.kt +29 -0
- package/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/values/strings.xml +3 -0
- package/android/app/src/main/res/values/styles.xml +9 -0
- package/android/build.gradle +21 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/android/gradle.properties +49 -0
- package/android/gradlew +248 -0
- package/android/gradlew.bat +98 -0
- package/android/settings.gradle +6 -0
- package/app.json +4 -0
- package/babel.config.js +3 -0
- package/index.js +12 -0
- package/ios/.xcode.env +11 -0
- package/ios/Podfile +34 -0
- package/ios/Podfile.lock +2179 -0
- package/ios/ReactNativeAlarm/AppDelegate.swift +14 -0
- package/ios/ReactNativeAlarm/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/ios/ReactNativeAlarm/Images.xcassets/Contents.json +6 -0
- package/ios/ReactNativeAlarm/Info.plist +79 -0
- package/ios/ReactNativeAlarm/LaunchScreen.storyboard +47 -0
- package/ios/ReactNativeAlarm/PrivacyInfo.xcprivacy +37 -0
- package/ios/ReactNativeAlarm/SceneDelegate.swift +56 -0
- package/ios/ReactNativeAlarm.xcodeproj/project.pbxproj +530 -0
- package/ios/ReactNativeAlarm.xcodeproj/xcshareddata/xcschemes/ReactNativeAlarm.xcscheme +88 -0
- package/ios/ReactNativeAlarm.xcworkspace/contents.xcworkspacedata +10 -0
- package/ios/alarm/AlarmData.swift +97 -0
- package/ios/alarm/AlarmKitBackend.swift +212 -0
- package/ios/alarm/AlarmModule.m +53 -0
- package/ios/alarm/AlarmModule.swift +284 -0
- package/ios/alarm/AlarmStore.swift +51 -0
- package/ios/alarm/NotificationBackend.swift +227 -0
- package/jest.config.js +3 -0
- package/metro.config.js +11 -0
- package/package.json +57 -3
- package/specs/NativeAlarm.ts +95 -0
- package/tsconfig.json +5 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import UIKit
|
|
2
|
+
|
|
3
|
+
@main
|
|
4
|
+
class AppDelegate: UIResponder, UIApplicationDelegate {
|
|
5
|
+
func application(
|
|
6
|
+
_ application: UIApplication,
|
|
7
|
+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
|
|
8
|
+
) -> Bool {
|
|
9
|
+
// Register the alarm notification delegate/actions before anything can fire, so a
|
|
10
|
+
// tap on an alarm notification that launches the app reaches the Alarm module.
|
|
11
|
+
NotificationBackend.install()
|
|
12
|
+
return true
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"images" : [
|
|
3
|
+
{
|
|
4
|
+
"idiom" : "iphone",
|
|
5
|
+
"scale" : "2x",
|
|
6
|
+
"size" : "20x20"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"idiom" : "iphone",
|
|
10
|
+
"scale" : "3x",
|
|
11
|
+
"size" : "20x20"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"idiom" : "iphone",
|
|
15
|
+
"scale" : "2x",
|
|
16
|
+
"size" : "29x29"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"idiom" : "iphone",
|
|
20
|
+
"scale" : "3x",
|
|
21
|
+
"size" : "29x29"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"idiom" : "iphone",
|
|
25
|
+
"scale" : "2x",
|
|
26
|
+
"size" : "40x40"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"idiom" : "iphone",
|
|
30
|
+
"scale" : "3x",
|
|
31
|
+
"size" : "40x40"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"idiom" : "iphone",
|
|
35
|
+
"scale" : "2x",
|
|
36
|
+
"size" : "60x60"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"idiom" : "iphone",
|
|
40
|
+
"scale" : "3x",
|
|
41
|
+
"size" : "60x60"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"idiom" : "ios-marketing",
|
|
45
|
+
"scale" : "1x",
|
|
46
|
+
"size" : "1024x1024"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"info" : {
|
|
50
|
+
"author" : "xcode",
|
|
51
|
+
"version" : 1
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CADisableMinimumFrameDurationOnPhone</key>
|
|
6
|
+
<true/>
|
|
7
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
8
|
+
<string>en</string>
|
|
9
|
+
<key>CFBundleDisplayName</key>
|
|
10
|
+
<string>ReactNativeAlarm</string>
|
|
11
|
+
<key>CFBundleExecutable</key>
|
|
12
|
+
<string>$(EXECUTABLE_NAME)</string>
|
|
13
|
+
<key>CFBundleIdentifier</key>
|
|
14
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
15
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
16
|
+
<string>6.0</string>
|
|
17
|
+
<key>CFBundleName</key>
|
|
18
|
+
<string>$(PRODUCT_NAME)</string>
|
|
19
|
+
<key>CFBundlePackageType</key>
|
|
20
|
+
<string>APPL</string>
|
|
21
|
+
<key>CFBundleShortVersionString</key>
|
|
22
|
+
<string>$(MARKETING_VERSION)</string>
|
|
23
|
+
<key>CFBundleSignature</key>
|
|
24
|
+
<string>????</string>
|
|
25
|
+
<key>CFBundleVersion</key>
|
|
26
|
+
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
27
|
+
<key>LSRequiresIPhoneOS</key>
|
|
28
|
+
<true/>
|
|
29
|
+
<key>NSAppTransportSecurity</key>
|
|
30
|
+
<dict>
|
|
31
|
+
<key>NSAllowsArbitraryLoads</key>
|
|
32
|
+
<false/>
|
|
33
|
+
<key>NSAllowsLocalNetworking</key>
|
|
34
|
+
<true/>
|
|
35
|
+
</dict>
|
|
36
|
+
<key>NSLocationWhenInUseUsageDescription</key>
|
|
37
|
+
<string></string>
|
|
38
|
+
<key>RCTNewArchEnabled</key>
|
|
39
|
+
<true/>
|
|
40
|
+
<key>UIApplicationSceneManifest</key>
|
|
41
|
+
<dict>
|
|
42
|
+
<key>UIApplicationSupportsMultipleScenes</key>
|
|
43
|
+
<false/>
|
|
44
|
+
<key>UISceneConfigurations</key>
|
|
45
|
+
<dict>
|
|
46
|
+
<key>UIWindowSceneSessionRoleApplication</key>
|
|
47
|
+
<array>
|
|
48
|
+
<dict>
|
|
49
|
+
<key>UISceneConfigurationName</key>
|
|
50
|
+
<string>Default Configuration</string>
|
|
51
|
+
<key>UISceneDelegateClassName</key>
|
|
52
|
+
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
|
53
|
+
</dict>
|
|
54
|
+
</array>
|
|
55
|
+
</dict>
|
|
56
|
+
</dict>
|
|
57
|
+
<key>UILaunchStoryboardName</key>
|
|
58
|
+
<string>LaunchScreen</string>
|
|
59
|
+
<key>UIRequiredDeviceCapabilities</key>
|
|
60
|
+
<array>
|
|
61
|
+
<string>arm64</string>
|
|
62
|
+
</array>
|
|
63
|
+
<key>UISupportedInterfaceOrientations</key>
|
|
64
|
+
<array>
|
|
65
|
+
<string>UIInterfaceOrientationPortrait</string>
|
|
66
|
+
</array>
|
|
67
|
+
<key>UISupportedInterfaceOrientations~ipad</key>
|
|
68
|
+
<array>
|
|
69
|
+
<string>UIInterfaceOrientationLandscapeLeft</string>
|
|
70
|
+
<string>UIInterfaceOrientationLandscapeRight</string>
|
|
71
|
+
<string>UIInterfaceOrientationPortrait</string>
|
|
72
|
+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
|
73
|
+
</array>
|
|
74
|
+
<key>UIViewControllerBasedStatusBarAppearance</key>
|
|
75
|
+
<false/>
|
|
76
|
+
<key>NSAlarmKitUsageDescription</key>
|
|
77
|
+
<string>This app needs access to alarms to wake you up on time.</string>
|
|
78
|
+
</dict>
|
|
79
|
+
</plist>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
|
3
|
+
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
|
4
|
+
<dependencies>
|
|
5
|
+
<deployment identifier="iOS"/>
|
|
6
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
|
|
7
|
+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
|
8
|
+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
|
9
|
+
</dependencies>
|
|
10
|
+
<scenes>
|
|
11
|
+
<!--View Controller-->
|
|
12
|
+
<scene sceneID="EHf-IW-A2E">
|
|
13
|
+
<objects>
|
|
14
|
+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
|
15
|
+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
|
16
|
+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
|
17
|
+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
|
18
|
+
<subviews>
|
|
19
|
+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ReactNativeAlarm" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
|
|
20
|
+
<rect key="frame" x="0.0" y="202" width="375" height="43"/>
|
|
21
|
+
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
|
|
22
|
+
<nil key="highlightedColor"/>
|
|
23
|
+
</label>
|
|
24
|
+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="MN2-I3-ftu">
|
|
25
|
+
<rect key="frame" x="0.0" y="626" width="375" height="21"/>
|
|
26
|
+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
|
27
|
+
<nil key="highlightedColor"/>
|
|
28
|
+
</label>
|
|
29
|
+
</subviews>
|
|
30
|
+
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
|
31
|
+
<constraints>
|
|
32
|
+
<constraint firstItem="Bcu-3y-fUS" firstAttribute="bottom" secondItem="MN2-I3-ftu" secondAttribute="bottom" constant="20" id="OZV-Vh-mqD"/>
|
|
33
|
+
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
|
|
34
|
+
<constraint firstItem="MN2-I3-ftu" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="akx-eg-2ui"/>
|
|
35
|
+
<constraint firstItem="MN2-I3-ftu" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="i1E-0Y-4RG"/>
|
|
36
|
+
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
|
|
37
|
+
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
|
|
38
|
+
</constraints>
|
|
39
|
+
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
|
|
40
|
+
</view>
|
|
41
|
+
</viewController>
|
|
42
|
+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
|
43
|
+
</objects>
|
|
44
|
+
<point key="canvasLocation" x="52.173913043478265" y="375"/>
|
|
45
|
+
</scene>
|
|
46
|
+
</scenes>
|
|
47
|
+
</document>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>NSPrivacyAccessedAPITypes</key>
|
|
6
|
+
<array>
|
|
7
|
+
<dict>
|
|
8
|
+
<key>NSPrivacyAccessedAPIType</key>
|
|
9
|
+
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
|
10
|
+
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
11
|
+
<array>
|
|
12
|
+
<string>C617.1</string>
|
|
13
|
+
</array>
|
|
14
|
+
</dict>
|
|
15
|
+
<dict>
|
|
16
|
+
<key>NSPrivacyAccessedAPIType</key>
|
|
17
|
+
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
|
|
18
|
+
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
19
|
+
<array>
|
|
20
|
+
<string>35F9.1</string>
|
|
21
|
+
</array>
|
|
22
|
+
</dict>
|
|
23
|
+
<dict>
|
|
24
|
+
<key>NSPrivacyAccessedAPIType</key>
|
|
25
|
+
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
|
26
|
+
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
27
|
+
<array>
|
|
28
|
+
<string>CA92.1</string>
|
|
29
|
+
</array>
|
|
30
|
+
</dict>
|
|
31
|
+
</array>
|
|
32
|
+
<key>NSPrivacyCollectedDataTypes</key>
|
|
33
|
+
<array/>
|
|
34
|
+
<key>NSPrivacyTracking</key>
|
|
35
|
+
<false/>
|
|
36
|
+
</dict>
|
|
37
|
+
</plist>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React
|
|
2
|
+
import React_RCTAppDelegate
|
|
3
|
+
import ReactAppDependencyProvider
|
|
4
|
+
import UIKit
|
|
5
|
+
|
|
6
|
+
class SceneDelegate: RCTDefaultReactNativeFactoryDelegate, UIWindowSceneDelegate {
|
|
7
|
+
var window: UIWindow?
|
|
8
|
+
var reactNativeFactory: RCTReactNativeFactory?
|
|
9
|
+
|
|
10
|
+
func scene(
|
|
11
|
+
_ scene: UIScene,
|
|
12
|
+
willConnectTo session: UISceneSession,
|
|
13
|
+
options connectionOptions: UIScene.ConnectionOptions
|
|
14
|
+
) {
|
|
15
|
+
guard let windowScene = scene as? UIWindowScene else {
|
|
16
|
+
return
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
dependencyProvider = RCTAppDependencyProvider()
|
|
20
|
+
reactNativeFactory = RCTReactNativeFactory(delegate: self)
|
|
21
|
+
window = UIWindow(windowScene: windowScene)
|
|
22
|
+
|
|
23
|
+
#if DEBUG
|
|
24
|
+
let devMenuConfiguration = RCTDevMenuConfiguration(
|
|
25
|
+
devMenuEnabled: true,
|
|
26
|
+
shakeGestureEnabled: true,
|
|
27
|
+
keyboardShortcutsEnabled: true
|
|
28
|
+
)
|
|
29
|
+
reactNativeFactory?.devMenuConfiguration = devMenuConfiguration
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
reactNativeFactory?.startReactNative(
|
|
33
|
+
withModuleName: "ReactNativeAlarm",
|
|
34
|
+
in: window,
|
|
35
|
+
connectionOptions: connectionOptions
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
|
|
42
|
+
RCTLinkingManager.scene(scene, openURLContexts: URLContexts)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
|
|
46
|
+
RCTLinkingManager.scene(scene, continue: userActivity)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
override func bundleURL() -> URL? {
|
|
50
|
+
#if DEBUG
|
|
51
|
+
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
|
|
52
|
+
#else
|
|
53
|
+
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
|
|
54
|
+
#endif
|
|
55
|
+
}
|
|
56
|
+
}
|