Evaluate the Swift source package and fail-closed signed-license verifier before a certified XCFramework is published.
Status
Preview
Integration
Embedded SDK
Distribution
Source preview
Version
0.1.0-RC4
Prerequisites
iOS 15 or newer
Swift 5.9
Apple Security framework
Source access to host-ios
1. Use the local Swift package
Use the local Swift package
.package(path: "../PrxVision/host-ios")
No certified remote Swift package or XCFramework is published for RC2.
2. Register a trusted key and apply JWS
Register a trusted key and apply JWS
let verifier = VisionScanJwsVerifier()
verifier.registerPublicKey(kid: keyId, algorithm: .rs256, key: secKey)
let manager = VisionScanEntitlementManager(verifier: verifier)
let result = manager.applySignedLicenseJws(
signedLicenseJws, expectedTenantId: tenantId, expectedDeviceId: deviceId)
guard result.isAllowed else { throw LicenseError.denied(result.denialReason) }
The host must obtain JWKS through authenticated control-plane networking and convert the selected key to SecKey.
3. Exercise the preview session lifecycle
Exercise the preview session lifecycle
let session = VisionScanSession(
configuration: .init(executionMode: .liveStreaming, matrixMode: .ar),
entitlementManager: manager)
try session.start()
// Feed sized AVFoundation luma frames or processLumaFrame(data:...).
let usage = try session.usageSnapshot()
session.close()
Build the native dependency first. Windows Swift source tests validate the real bridge; Apple camera/Security builds and certified delivery remain gates.
Errors and recovery
Condition
Resolution
ERR_JWS_UNKNOWN_KEY
Refresh JWKS and register the exact kid and algorithm before applying the token.
No decoded observations
Expected in the current source preview; use Android evaluation for a certified customer first-scan journey.
Production checklist
Do not ship the source preview as a supported binary
Keep JWKS retrieval and SecKey conversion host-owned
Test malformed, expired, revoked, and cross-device JWS values
Wait for XCFramework publication and certification
Public contract reference
These are the callable methods and HTTP operations used by this guide. Inputs, results, lifecycle rules, and denial behavior are part of the versioned customer contract.
iOS signed-license preview
The source preview verifies JWS claims with Apple Security and does not trust caller-created licenses.
liveStreaming is bridged; batchThroughput/highResolutionRescue and non-default preprocessing profiles are rejected until their configuration bridge is implemented.
Real native stable barcode observations, latestMatrixFrame tracks/count/geometry/target/pick state and separate content-free usage snapshots.
Lifecycle
Start once, pause/resume around capture lifecycle, and close deterministically.
Trust boundary
Use for API evaluation only until signed XCFramework packaging and physical-device certification are complete.
Failure behavior
Invalid descriptors, unsupported configuration and unverified entitlements fail closed.
Windows Swift tests do not certify Apple camera, Security or device execution.
VisionScanMatrixUsageSnapshot.init(nativeJSON: Data) throws; jsonData() throws -> Data
method
Validate and round-trip content-free native visionscan-matrix-usage/v1 snapshots; not an automatic telemetry reporter.
Inputs for VisionScanMatrixUsageSnapshot.init(nativeJSON: Data) throws; jsonData() throws -> Data
Input
Type
Required
Meaning
nativeJSON
Data
Yes
Bounded UTF-8 native snapshot without the terminating C NUL; no image, payload, geometry, or identity fields.
Result
Immutable typed counters for Batch, AR, Count, Find, or Pick and a closed symbology histogram.
Lifecycle
Read active counters through usageSnapshot; opt-in VisionScanMatrixTelemetry reserves and durably acknowledges separate windows. Enrolled delivery still requires runtime validation.
Trust boundary
No tenant override, keys, tokens, barcode values, or capture bytes. This source codec is not device-to-tenant delivery certification.
Failure behavior
Unknown/missing fields, invalid versions/modes, negative or out-of-range counters and inconsistent totals throw.
Foundation duplicate-key detection is not provided; Apple compilation and XCTest remain acceptance gates.
Deliver opt-in, content-free native usage through a bounded durable outbox using backend-verified enrollment.
Inputs for VisionScanMatrixTelemetry.init(session:entitlementManager:controlPlaneOrigin:sdkVersion:storage:maximumQueuedEvents:reportIntervalSeconds:tokenProvider:) throws; flush(completion:); finish(completion:)
Input
Type
Required
Meaning
storage
VisionScanMatrixTelemetryStorage
Yes
Apple hosts use VisionScanAppleTelemetryStorage: Keychain key and authenticated AES-GCM, no plaintext fallback.
Result
Typed ready/uploaded/retry/authorization/rejection/identity/full/storage/closed states; stable replay IDs and strict per-event acknowledgments.
Lifecycle
Keep session/storage/reporter alive. Stop capture, then finish to persist the last native window before closing. Storage/full/identity failure preserves the paused session.
Trust boundary
Tenant is backend-derived; no raw license, token, barcode or frame content is persisted or transmitted. Transport retains default TLS trust and denies redirects.
Failure behavior
Unverified enrollment, non-HTTPS origins and invalid configuration throw.
Corrupt or foreign outboxes fail closed. Apple crypto/TLS and enrolled delivery are unverified external gates.
Review the release support matrix before deployment. Support status and contract failure behavior remain authoritative even when an example is copied.