@craft-native/ios 0.0.345 → 0.0.348
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.json
CHANGED
package/templates/CraftApp.swift
CHANGED
|
@@ -9676,7 +9676,7 @@ final class CraftZigRuntime: NSObject {
|
|
|
9676
9676
|
enum CraftWebServices {
|
|
9677
9677
|
private static var waiting: [String: (Result<Any, CraftNativeActionError>) -> Void] = [:]
|
|
9678
9678
|
/// Coordinator events a native screen hears too.
|
|
9679
|
-
static let forwardedEvents: Set<String> = ["craftLocationUpdate", "craftLocationError", "craftHealthHeartRate", "craftHealthWorkout", "craftMusicChange", "craftHeartRate"]
|
|
9679
|
+
static let forwardedEvents: Set<String> = ["craftNetworkChange", "craftLocationUpdate", "craftLocationError", "craftHealthHeartRate", "craftHealthWorkout", "craftMusicChange", "craftHeartRate"]
|
|
9680
9680
|
static let event = Notification.Name("craftWebServicesEvent")
|
|
9681
9681
|
|
|
9682
9682
|
static var isAvailable: Bool { CraftSwiftShim.coordinator != nil }
|
|
@@ -43,6 +43,7 @@ enum CraftNativeActions {
|
|
|
43
43
|
// `speech`, `audio` (background sound) and `eventStream` (a fetch read
|
|
44
44
|
// as it arrives) need nothing the app has to declare.
|
|
45
45
|
var values = ["device", "clipboard", "haptics", "storage", "lifecycle", "fetch", "dialog", "speech", "audio", "eventStream", "linking", "badge", "animation", "viewFocus", "viewMeasure", "viewReparent", "viewNonModalPresentation", "nativePlatformControls"]
|
|
46
|
+
values.append("network")
|
|
46
47
|
values.append("nativePager")
|
|
47
48
|
values.append("storageCompareAndSet")
|
|
48
49
|
values.append("storageSetIfAbsent")
|
|
@@ -245,6 +246,9 @@ enum CraftNativeActions {
|
|
|
245
246
|
}
|
|
246
247
|
authenticate(requestToken: requestToken, args: args, completion: completion)
|
|
247
248
|
return
|
|
249
|
+
case ("Network", "getStatus"):
|
|
250
|
+
CraftWebServices.perform(action: "getNetworkStatus", body: [:]) { complete(requestToken, $0, completion) }
|
|
251
|
+
return
|
|
248
252
|
case ("Network", "fetch"):
|
|
249
253
|
fetch(requestToken: requestToken, args: args, completion: completion)
|
|
250
254
|
return
|