Verdict Capture iOS Integration
There is no separate Swift package. A native iOS app sends photos to the Verdict Capture REST API with URLSession, opens a hosted inspection link in SFSafariViewController for guided vehicle inspections, or, if it is built with React Native or Flutter, uses our SDK for that framework.
Quick Start
1. Install
<!-- Nothing to add to Package.swift or a Podfile: URLSession and SafariServices ship with iOS. -->
<!-- Info.plist, only if your app takes the photo itself: -->
<key>NSCameraUsageDescription</key>
<string>Take a photo to verify parking</string>2. Use
import Foundation
struct Verification: Decodable {
let id: String
let isCompliant: Bool
let confidence: Double
let violationReasons: [String]
let feedback: String
}
/// POST /api/v1/verify with the photo as multipart form data.
func verifyPhoto(_ jpeg: Data, policy: String, apiKey: String) async throws -> Verification {
let boundary = "Boundary-\(UUID().uuidString)"
var request = URLRequest(url: URL(string: "https://verdictcapture.com/api/v1/verify")!)
request.httpMethod = "POST"
request.setValue(apiKey, forHTTPHeaderField: "X-API-Key")
request.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")
var body = Data()
body.append("--\(boundary)\r\nContent-Disposition: form-data; name=\"policy\"\r\n\r\n\(policy)\r\n".data(using: .utf8)!)
body.append("--\(boundary)\r\nContent-Disposition: form-data; name=\"image\"; filename=\"photo.jpg\"\r\nContent-Type: image/jpeg\r\n\r\n".data(using: .utf8)!)
body.append(jpeg)
body.append("\r\n--\(boundary)--\r\n".data(using: .utf8)!)
let (data, response) = try await URLSession.shared.upload(for: request, from: body)
guard (response as? HTTPURLResponse)?.statusCode == 200 else {
throw URLError(.badServerResponse)
}
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
return try decoder.decode(Verification.self, from: data)
}
// let result = try await verifyPhoto(jpegData, policy: "scooter_parking", apiKey: apiKey)
// result.isCompliant ? endRide() : show(result.feedback)Features
Plain URLSession
One multipart POST to /api/v1/verify with an X-API-Key header. No third-party dependency, bridging header or binary framework to add.
Hosted Guided Inspections
Open a signed inspection link in SFSafariViewController. Framing guides, retakes, camera access and submission run on our page, with no camera code in your app.
Signed Results on Your Backend
verification.completed and inspection.submitted webhooks arrive signed at your server, so a decision never depends on what the device reports.
Keys Stay Server-Side
For inspections, your backend creates the session with your API key and the app receives only an expiring capture link.
Cross-Platform SDKs
Building with React Native or Flutter? Those SDKs add a camera scanner with retry guidance, an offline queue and a native guided inspection screen.
Same API Everywhere
The request and response are identical from iOS, Android, a browser or a server, so one backend integration serves every client.
Code Examples
Requirements
- iOS 15 or later for async URLSession (completion handlers work on earlier versions)
- NSCameraUsageDescription in Info.plist if your app captures the photo
- A Verdict Capture API key; for inspections it stays on your backend
- An HTTPS return_url (universal link) if the hosted inspection should return to your app
Frequently Asked Questions
Add Photo Verification to Your iOS App
Get an API key and send your first verification from Swift today.
Other ways to integrate
Mobile SDKs, server-side HTTP examples, the REST API, webhooks, and no-code automation platforms.