Customization
We currently support functional customization in the cases listed below, with more to be added later. Visual/branding customization will not be supported.
Localization
Localization of messages and errors is supported using a String Catalog. The comprehensive list of localised keys is provided below:
| Key | English (en) | Comment |
|---|---|---|
| document_auto_capture | Auto-capture - ON | Toggle label for auto-capture feature |
| document_auto_capture_info | Once the picture is clear, we’ll automatically take a photo. | Help modal auto-capture info |
| document_auto_capture_off | Auto-capture - OFF | Toggle label for auto-capture feature |
| document_auto_capture_tip | Still struggling to take a photo, turn off Auto capture | Help modal auto-capture tip |
| document_avoid_glare | Move your document away from direct light sources | Instruction to avoid glare when scanning document |
| document_blurry | Document is unclear and blurry | Error message when document image is not clear |
| document_cancel | Cancel | Cancel confirmation button |
| document_cancel_confirmation | Are you sure you want to end your identity check? | Confirmation message for user when cancelling the scan |
| document_cancel_confirmed | User cancelled the scan | Confirmation message that the user cancelled the scan |
| document_continue | Continue | Continue button |
| document_end | End | End confirmation button |
| document_error_component_camera | Camera | Indicates the error was in the camera component |
| document_error_component_other | Other | Indicates the error was in the other component |
| document_error_component_smart_capture | SmartCapture | Indicates the error was in the Smart Capture error component |
| document_fill_frame | Fill the entire frame with your document | Help modal fill frame instruction |
| document_fill_frame_instruction | Fill your document fully within the frame | Instruction to position document to fill the scanning area |
| document_glare | Light reflection visible on document | Error message when there's glare on the document |
| document_help_title | How to take a photo of your identity document | Help modal title |
| document_hold_phone | Hold your phone steady | Help modal hold phone instruction |
| document_hold_steady | Hold your document and device steady | Instruction to keep device still while scanning |
| document_hold_still | Hold still | Instruction to hold still while the document is confirmed |
| document_lighting | Use a well lit area but avoid any strong overhead lighting | Help modal lighting instruction |
| document_not_detected | Document not detected | Instruction to highlight that we don't see a document |
| document_photo_captured | Photo captured | Success message when document photo is taken |
| document_place_back | Place your document BACK SIDE up on a flat surface and: | Help modal subtitle |
| document_place_photo | Place your document PHOTO SIDE up on a flat surface and: | Help modal subtitle |
| document_scanning_front_side | Position the PHOTO PAGE of your document within the frame below | Instruction for user to place the photo page of the document in the scanning area |
| document_scanning_back_side | Position the BACK of your document within the frame below | Instruction for user to place the back of the document in the scanning area |
| document_too_small | Document does not fill the frame | Error message when document is too small in frame |
How to Integrate
- Add a string catalog to your project.
- Include the keys listed above.
- Customise the message.
- Add additional languages.
- Introduce the translated copy for each key.
- Add an additional string catalog named InfoPlist.xcstrings to your project to localize the Info.plist file of your project.
- Add a key named NSCameraUsageDescription to customize the camera permission request message.
On-Capture Shutter Effect
An on-capture shutter effect is supported, providing visual, haptic, and audio feedback the moment a document is captured. This flashes the screen black, triggers haptic feedback, and plays a sound bite. The configurable options are listed below:
| Effect | Default Setting | Description |
|---|---|---|
| Screen Flash | True | The screen will flash black once when a document is captured. |
| Haptic Feedback | False | The user will feel a sense of touch known as haptic feedback when a document is captured. |
| Sound | False | The default iOS sound bite will be played when a document is captured. |
How to Integrate
This feature can be customised during the initial configuration of DocumentSDK, using the configureShutter method within DocumentScannerConfig. Below is an example:
struct ContentView: View {
@StateObject var documentSDK: DocumentSDK
init() {
var config = DocumentScannerConfig(autoCaptureToggleConfig: .showDelayed(), documentSide: .front)
config.configureShutter(screenFlash: true, hapticFeedback: true, sound: true)
_documentSDK = StateObject(wrappedValue: DocumentSDK(documentScannerConfig: config))
}
...
}