Preparation
The Speech Verifier is included in the Amani Core SDK for iOS. It is not distributed as a separate SDK or framework.
The module presents a camera-based verification screen where the user reads a passphrase aloud and, optionally, answers knowledge-based identity questions. Speech is evaluated live, matching passphrase words are highlighted on screen, and the session can be recorded as video evidence for upload to the Amani backend.
let verifier = amani.speechVerifier()
The iOS Speech Verifier is different from the Android standalone package. On iOS it is part of the Amani Core SDK and uses Apple's speech-recognition APIs. Do not document the iOS module as a separate dependency or as a fully offline recognizer.
Requirements
- iOS 13.0 or later
- Amani Core SDK integrated and initialized
- A valid customer/profile context for evidence upload
- A valid customer/profile context when identity answers will be fetched automatically
- A physical device is recommended for camera, microphone, and speech-recognition testing
SDK Integration
No additional Speech Verifier dependency is required. If the Amani Core SDK is already integrated, the module is available through:
let verifier = amani.speechVerifier()
There is no iOS equivalent of the Android Speech Verifier Maven/JFrog dependency, ProGuard configuration, or R8 consumer rules.
For remote-configured KYC journeys, the Speech Verifier step and its document type must also be enabled for the customer profile on the Amani backend. Calling the SDK API alone does not make a remote-configured Speech Verifier step appear in a KYC flow.
Required Permissions
Add the following usage-description keys to the host application's Info.plist:
<key>NSCameraUsageDescription</key>
<string>Camera access is required to record the speech verification session.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Microphone access is required to verify the spoken text.</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>Speech recognition is required to verify the spoken text.</string>
The module requests camera, microphone, and speech-recognition authorization when the flow starts.
Calling an Apple permission API without the corresponding Info.plist usage-description key can terminate the host application. Configure all required keys before using Speech Verifier.
When permission is denied, the module reports the corresponding SpeechVerifierFailureReason through onFailure and presents the supported retry/settings UX.
Location is optional. Add NSLocationWhenInUseUsageDescription only when the host application itself obtains a CLLocation and passes it to upload(location:completion:).
Important Integration Notes
- Keep a strong reference to the
SpeechVerifierinstance until verification and upload are complete. - Keep the returned
UIViewin the view hierarchy while the flow is active. start()returns a view; the host application is responsible for presenting and constraining it.- Keep video recording enabled for production evidence collection unless the Amani team specifies otherwise.
- Do not release the verifier inside
onSuccessbefore callingupload(...). onSuccessindicates that the local verification flow has succeeded. It does not upload evidence automatically.- Apple's speech recognizer can temporarily become unavailable. Treat
speechRecognitionUnavailableas a real runtime state. - Supported mismatch/timeout failures show the module's own Retry UI. Do not immediately remove the view for every
onFailurecallback.
Direct Core SDK vs AmaniUI
Speech Verifier can be used in two ways:
Direct Core SDK integration
The host application creates and configures SpeechVerifier directly:
let verifier = amani.speechVerifier()
.documentType("XXX_ST_0")
.setText("I approve this verification", 90)
The host application owns presentation, lifecycle, callbacks, and the final upload call.
AmaniUI / remote-configured flow
When Speech Verifier is started through AmaniUI, AmaniUI maps the backend configuration into the Core SDK. This can include:
- document type;
- timeout;
- passphrase / identity-question steps;
- per-step match thresholds;
- identity prompts;
- UI texts;
- UI colors;
- exempt words;
- Voice Assistant configuration.
In that flow, applications normally do not create a second SpeechVerifier instance manually.
Android Differences
| Topic | iOS | Android |
|---|---|---|
| Distribution | Included in Amani Core SDK | Standalone Speech Verifier package |
| Recognition | Apple Speech APIs | Android module's offline recognizer |
| UI object | UIView | Fragment |
| Permissions | Host Info.plist usage descriptions | Manifest permissions + runtime request |
| Customer/profile session | Existing Amani Core SDK context | Standalone session(serverURL, token) API |
| ProGuard / R8 | Not applicable | Android-specific |
| Voice guidance | Built into iOS Speech Verifier through AmaniVoiceAssistant | Platform-specific Android behavior |