General Considerations¶
The NFC SDK follows the same structure as the rest of the Veridas iOS SDKs (Document, Selfie and Video). If you already integrate any of them, the integration of the NFC SDK will be familiar: a static facade (NfcRead), a delegate for the results and lifecycle callbacks (NfcReadDelegate), an optional delegate for the events (NfcReadEventsDelegate), and a Codable configuration. Below are the key considerations for developers and integration teams.
Modular JSON Configuration Structure¶
The configuration structure is modularized into four distinct sections, each managed either through a separate file or as a root-level key within the JSON structure.
- Medias (medias)
- All references to images and media resources (for example, logos or illustrations) can be placed in a separate file, or under the root-level
mediaskey in the JSON. logoandlogoSmallare plain strings. Every other image is an object with themobilekey, the same shape as in the Android SDK.- Each image can be an asset catalog image name (
"tutorial_screen"), a file of the app bundle with its extension ("tutorial_screen.gif"), or anhttpsURL. See Where each image is loaded from.
- All references to images and media resources (for example, logos or illustrations) can be placed in a separate file, or under the root-level
- Setup (setup)
- All SDK configuration (for example, the maximum number of reading attempts) can be placed in a separate file, or under the root-level
setupkey in JSON. - This includes all configurable parts of the SDK, and the document data used to open the chip (
prefill), which is usually set at runtime.
- All SDK configuration (for example, the maximum number of reading attempts) can be placed in a separate file, or under the root-level
- Styles (styles)
- All UI customization parameters (for example, color palette, typography, component styles) can be declared in a separate file, or under the root-level
styleskey in the JSON. - The styles are shared with the rest of the Veridas iOS SDKs, so the same definition can be reused across all of them.
- All UI customization parameters (for example, color palette, typography, component styles) can be declared in a separate file, or under the root-level
- Texts (texts)
- All text-related content can be placed in a separate file, or under the root-level
textskey in the JSON. - This includes interface messages, titles, instructions and the messages of the system NFC sheet.
- All text-related content can be placed in a separate file, or under the root-level
Migration Summary and Best Practices¶
To ensure a successful integration, organize your JSON configurations following the modular model. This structure offers greater flexibility and scalability, making it especially effective for clients who need dynamic, localized, or branded experiences.
When the NFC reading follows a document capture, pass the MRZ data obtained from the document as prefill, so the user does not have to type it.
Migrating from v1.0 to v1.1¶
Medias¶
In v1.1, every image of medias except logo and logoSmall is an object with the mobile key, the same format as the Android SDK. If you customize any of these images, move each value under mobile.
Before (v1.0):
"medias": {
"reading": {
"presentation": "https://domain.com/images/nfc_reading_presentation.gif"
},
"error": {
"timeout": "nfc_timeout_error"
}
}
After (v1.1):
"medias": {
"reading": {
"presentation": {
"mobile": "https://domain.com/images/nfc_reading_presentation.gif"
}
},
"error": {
"timeout": {
"mobile": "nfc_timeout_error"
}
}
}
logo, logoSmall and instructions.mobile do not change. The alternative texts of the images do not change either.
Behaviour changes¶
No other change is required in the integration, but take into account these changes if your app depends on them:
VD_nfcCancelledis sent only when the user leaves the process. It is no longer sent when the app callsNfcRead.stop()or when the user cancels the system NFC sheet. See Events.- Retrying after a failed reading no longer shows the document data form, unless the data was wrong.
- closeButtonShow only hides the close button: the Cancel button of the document data form is always shown.
- The document number of the form is no longer limited to 9 characters. If you customized its helper texts, remove any mention of 9 characters or of the
<symbols. See Recommendations.