@capgo/capacitor-alarm 7.1.13 → 7.1.15
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/Package.swift
CHANGED
|
@@ -6,15 +6,15 @@ import AlarmKit
|
|
|
6
6
|
|
|
7
7
|
class AlarmKitBridge {
|
|
8
8
|
static func isAvailable() -> Bool {
|
|
9
|
-
#if canImport(AlarmKit)
|
|
9
|
+
#if canImport(AlarmKit)
|
|
10
10
|
if #available(iOS 26.0, *) { return true } else { return false }
|
|
11
|
-
#else
|
|
11
|
+
#else
|
|
12
12
|
return false
|
|
13
|
-
#endif
|
|
13
|
+
#endif
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
static func requestAuthorization(completion: @escaping (Bool, String?) -> Void) {
|
|
17
|
-
#if canImport(AlarmKit)
|
|
17
|
+
#if canImport(AlarmKit)
|
|
18
18
|
if #available(iOS 26.0, *) {
|
|
19
19
|
Task {
|
|
20
20
|
do {
|
|
@@ -28,19 +28,19 @@ class AlarmKitBridge {
|
|
|
28
28
|
}
|
|
29
29
|
return
|
|
30
30
|
}
|
|
31
|
-
#endif
|
|
31
|
+
#endif
|
|
32
32
|
completion(false, "AlarmKit not available on this device/SDK")
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
static func createAlarm(hour: Int, minute: Int, label: String?, completion: @escaping (Bool, String?) -> Void) {
|
|
36
|
-
#if canImport(AlarmKit)
|
|
36
|
+
#if canImport(AlarmKit)
|
|
37
37
|
if #available(iOS 26.0, *) {
|
|
38
38
|
// TODO: Replace with real AlarmKit calls.
|
|
39
39
|
// We intentionally avoid guessing API surface to prevent compilation/runtime issues.
|
|
40
40
|
completion(false, "AlarmKit integrated but no concrete API wired. Provide exact AlarmKit API usage.")
|
|
41
41
|
return
|
|
42
42
|
}
|
|
43
|
-
#endif
|
|
43
|
+
#endif
|
|
44
44
|
completion(false, "AlarmKit not available on this device/SDK")
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -45,12 +45,12 @@ public class CapgoAlarmPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// Capacitor permission lifecycle
|
|
48
|
-
public
|
|
48
|
+
override public func checkPermissions(_ call: CAPPluginCall) {
|
|
49
49
|
// No explicit runtime permission needed for AlarmKit; always granted when available
|
|
50
50
|
call.resolve(["granted": true])
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
public
|
|
53
|
+
override public func requestPermissions(_ call: CAPPluginCall) {
|
|
54
54
|
// Request AlarmKit authorization when available
|
|
55
55
|
if !AlarmKitBridge.isAvailable() {
|
|
56
56
|
call.resolve(["granted": false])
|