diff --git a/apps/ios/Sources/Info.plist b/apps/ios/Sources/Info.plist index 69909f292..c2f22b5e6 100644 --- a/apps/ios/Sources/Info.plist +++ b/apps/ios/Sources/Info.plist @@ -26,11 +26,6 @@ _clawdis-bridge._tcp - NSAppTransportSecurity - - NSAllowsArbitraryLoadsInWebContent - - NSCameraUsageDescription Clawdis can capture photos or short video clips when requested via the bridge. NSLocalNetworkUsageDescription diff --git a/apps/ios/Sources/Model/NodeAppModel.swift b/apps/ios/Sources/Model/NodeAppModel.swift index 18d281834..8fd76d643 100644 --- a/apps/ios/Sources/Model/NodeAppModel.swift +++ b/apps/ios/Sources/Model/NodeAppModel.swift @@ -365,7 +365,7 @@ final class NodeAppModel { private func handleInvoke(_ req: BridgeInvokeRequest) async -> BridgeInvokeResponse { let command = req.command - if (command.hasPrefix("canvas.") || command.hasPrefix("camera.") || command.hasPrefix("screen.")), + if command.hasPrefix("canvas.") || command.hasPrefix("camera.") || command.hasPrefix("screen."), self.isBackgrounded { return BridgeInvokeResponse( diff --git a/apps/ios/Sources/Screen/ScreenController.swift b/apps/ios/Sources/Screen/ScreenController.swift index 8c64e9fec..43baf4728 100644 --- a/apps/ios/Sources/Screen/ScreenController.swift +++ b/apps/ios/Sources/Screen/ScreenController.swift @@ -195,11 +195,11 @@ final class ScreenController { ?? bundle.url(forResource: name, withExtension: ext) } - private static let canvasScaffoldURL: URL? = Self.bundledResourceURL( + private static let canvasScaffoldURL: URL? = ScreenController.bundledResourceURL( name: "scaffold", ext: "html", subdirectory: "CanvasScaffold") - private static let a2uiIndexURL: URL? = Self.bundledResourceURL( + private static let a2uiIndexURL: URL? = ScreenController.bundledResourceURL( name: "index", ext: "html", subdirectory: "CanvasA2UI") diff --git a/apps/ios/Sources/Screen/ScreenRecordService.swift b/apps/ios/Sources/Screen/ScreenRecordService.swift index 0c8706562..55be26aae 100644 --- a/apps/ios/Sources/Screen/ScreenRecordService.swift +++ b/apps/ios/Sources/Screen/ScreenRecordService.swift @@ -10,12 +10,12 @@ final class ScreenRecordService { var errorDescription: String? { switch self { - case let .invalidScreenIndex(idx): - return "Invalid screen index \(idx)" + case let .invalidScreenIndex(idx): + "Invalid screen index \(idx)" case let .captureFailed(msg): - return msg + msg case let .writeFailed(msg): - return msg + msg } } } @@ -111,7 +111,8 @@ final class ScreenRecordService { } guard w.startWriting() else { - throw ScreenRecordError.writeFailed(w.error?.localizedDescription ?? "Failed to start writer") + throw ScreenRecordError + .writeFailed(w.error?.localizedDescription ?? "Failed to start writer") } w.startSession(atSourceTime: pts) writer = w @@ -180,8 +181,8 @@ final class ScreenRecordService { } private nonisolated static func clampDurationMs(_ ms: Int?) -> Int { - let v = ms ?? 10_000 - return min(60_000, max(250, v)) + let v = ms ?? 10000 + return min(60000, max(250, v)) } private nonisolated static func clampFps(_ fps: Double?) -> Double { @@ -189,5 +190,4 @@ final class ScreenRecordService { if !v.isFinite { return 10 } return min(30, max(1, v)) } - }