iOS
Platform Config
iOS configuration with backend contract parity
Configuration Strategy
iOS config should mirror Android semantics:
Info.plist Configuration
<!-- SDK Configuration -->
<key>KYCISBackendBaseURL</key>
<string>https://kycis.zynnex.in/v1</string>
<key>KYCISClientID</key>
<string>your_client_id</string>
<key>KYCISMappingVersion</key>
<string>v1</string>
<key>KYCISConfigRefreshInterval</key>
<integer>60</integer>Runtime Policy
struct RuntimePolicy {
let backendBaseUrl: String
let clientId: String?
let mappingVersion: String?
let appVersion: String?
let triggerStartMode: TriggerStartMode
let passiveEvalEnabled: Bool
let passiveEvalIntervalSeconds: Int
}
enum TriggerStartMode {
case immediate
case cooldown(minIntervalSeconds: Int)
case confirmUI(title: String, startCta: String, dismissCta: String)
}Backend Contract Alignment
Event Semantics
Same as Android:
| Event | Purpose |
|---|---|
identity | User identification |
screen_schema | Screen structure registration |
component_input | User input hints (masked) |
validation_failed | Field validation errors |
error_reported | Generic errors |
Payload Fields
Same field semantics:
session_id— unique per app sessionuser_id— stable user identifierscreen/screen_id— current screencomponent_id/component_type— UI component contexthint+masked— redacted input hintstraceparent,trace_id,request_id— correlation
HTTP Headers
Required headers on all SDK requests:
X-API-Key: your-api-key
X-KYCIS-SDK-Version: 1.0.0
X-Client-ID: your_client_id
Content-Type: application/jsonVoice Configuration
LiveKit Integration
Same flow as Android:
- Get token/room from
POST /v1/assistant/session/start - Connect to LiveKit room
- Publish microphone track
- Listen for agent
Audio Session Configuration
let audioSession = AVAudioSession.sharedInstance()
try audioSession.setCategory(.playAndRecord, mode: .voiceChat)
try audioSession.setActive(true)Remote Config
Same endpoint and behavior:
GET /v1/sdk/config
Headers:
X-KYCIS-SDK-Version: 1.0.0
X-Client-ID: your_client_idRefresh periodically during active sessions.
Debug Configuration
For development:
#if DEBUG
let policy = RuntimePolicy(
backendBaseUrl: "http://localhost:8000/v1",
// ... other settings
)
#else
let policy = RuntimePolicy(
backendBaseUrl: "https://kycis.zynnex.in/v1",
// ... other settings
)
#endifSecurity
- Store API keys in Keychain, not plist
- Use certificate pinning for production
- Obfuscate SDK internals if needed