Customization
We provide customization options, including localisation support, configurable fonts and colors.
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 |
|---|---|---|
| ozone_nfc_authentication | Authentication | A section title for authentication details in the NFC result view. |
| ozone_nfc_error | Error | The title of an alert that appears when an error occurs. |
| ozone_nfc_error_invalid_nfc_key_formatting | Invalid NFC Key Formatting | An error message displayed when the NFC key formatting is invalid. |
| ozone_nfc_error_invalid_nfc_tag | Invalid NFC Tag | An error message displayed when the NFC tag is invalid. |
| ozone_nfc_error_unexpected_error | Unexpected error | An error message displayed when there is an unexpected error. |
| ozone_nfc_error_user_cancelled | User cancelled | An error message displayed when the user has cancelled the process. |
| ozone_nfc_failed | Failed | A label that indicates whether the BAC authentication was successful or not. |
| ozone_nfc_instruction_different_page_subtitle | If you are struggling to scan the NFC chip. Try scanning the front, middle, photo page or inner back pages of your document. | A label that instructs the user to try different pages of their passport (subtitle). |
| ozone_nfc_instruction_different_page_title | Try a different page | A label that instructs the user to try different pages of their passport (title). |
| ozone_nfc_instruction_hold_still_subtitle | When the dots are progressing, the phone is scanning the document. Hold the phone and document still. | A label that instructs the user to hold their phone still while scanning (subtitle). |
| ozone_nfc_instruction_hold_still_title | Hold phone and document still | A label that instructs the user to hold their phone still while scanning (title). |
| ozone_nfc_instruction_page_title | How to scan the NFC chip | A label that shows the title of the instructions page. |
| ozone_nfc_instruction_remove_subtitle | Remove any covers or sleeves from your document. | A label that instructs the user to remove any document covers (subtitle). |
| ozone_nfc_instruction_remove_title | Remove any document covers | A label that instructs the user to remove any document covers (title). |
| ozone_nfc_instruction_slide_subtitle | Slide your phone slowly up and down the document until you see the dots progress. | A label that instructs the user to slide the phone to find the NFC chip (subtitle). |
| ozone_nfc_instruction_slide_title | Slide phone up and down | A label that instructs the user to slide the phone to find the NFC chip (title). |
| ozone_nfc_instruction_touch_subtitle | Make sure the back of your phone and document are touching. | A label that instructs the user to touch the phone and document together (subtitle). |
| ozone_nfc_instruction_touch_title | Touch phone against document | A label that instructs the user to touch the phone and document together (title). |
| ozone_nfc_no | No | A response indicating that the passport data is valid. |
| ozone_nfc_passport_number | Passport Number | A label for the passport number field. |
| ozone_nfc_scan_state_authenticating | Authenticating | A string to indicate that the status of the users scan is authenticating. |
| ozone_nfc_scan_state_authenticating_with_passport | Authenticating with passport | A string to indicate that the status of the users scan is authenticating with passport. |
| ozone_nfc_scan_state_connection_error_try_again | Connection error. Please try again. | A string to indicate that the status of the users scan had a problem with the connection and the user should try again. |
| ozone_nfc_scan_state_hold_phone_near_nfc_passport | Hold your iPhone near an NFC enabled passport. | A string to indicate that the status of the users scan hasn’t started and the user should hold their phone near an NFC enabled passport. |
| ozone_nfc_scan_state_more_than_one_tag_found | More than 1 tags was found. Please present only 1 tag. | A string to indicate that the status of the users scan has found more than one tag. |
| ozone_nfc_scan_state_mrz_key_not_valid | MRZ Key not valid for this document. | A string to indicate that the status of the users scan has encountered problem with the MRZ key. |
| ozone_nfc_scan_state_passport_read_successfully | Passport read successfully | A string to indicate that the status of the users scan has been successful. |
| ozone_nfc_scan_state_problem_reading_passport | Sorry, there was a problem reading the passport. | A string to indicate that the status of the users scan has been unsuccessful. |
| ozone_nfc_scan_state_problem_reading_passport_try_again | Sorry, there was a problem reading the passport. Please try again. | A string to indicate that the status of the users scan has been unsuccessful and to try again. |
| ozone_nfc_scan_state_reading | Reading | A string to indicate that the status of the users scan is reading the document. |
| ozone_nfc_scan_state_tag_not_valid | Tag not valid. | A string to indicate that the status of the users scan has encountered an invalid tag. |
| ozone_nfc_start_scanning | Start scanning | A button which allows the user to start scanning. |
| ozone_nfc_succeeded | Succeeded | A label that indicates whether the BAC authentication was successful or not. |
| ozone_nfc_yes | Yes | A positive response to a boolean question. |
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.
- Register your bundle with the SDK so it uses your catalog instead of the built-in defaults:
OzoneNFCUIAppearance.shared.customBundle = Bundle.main
- If your catalog uses a non-default name, set
customStringTableNameto match:
OzoneNFCUIAppearance.shared.customStringTableName = "MyStrings"
- 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.
Font Customisation
Ozone NFC provides flexible options for customising the typeface, size, and colour of all text elements within the interface.
If you need guidance on integrating custom fonts into your app, refer to Apple’s documentation: Adding a Custom Font to Your App.
Typefaces and Sizes:
The following text elements support custom typefaces and font sizes:
| Label Type | Attribute | Example |
|---|---|---|
| Title | titleFont | "How to scan the NFC chip" |
| Header | headerFont | "Touch phone against document" |
| Paragraph | paragraphFont | "Make sure the back of your phone and document are touching." |
| Button | buttonFont | "Start scanning" |
Button sizing can also be customised:
| Attribute | Description |
|---|---|
buttonTextSize | Font size for button labels |
buttonBorderRadius | Corner radius of buttons |
buttonBorderWidth | Width of button borders |
The following colour values can be customised to match your app’s visual identity:
| Type | Attribute | Default Value |
|---|---|---|
| Title Text | titleColor | #000000 |
| Header Text | headerColor | #000000 |
| Paragraph | paragraphColor | #000000 |
| View Controller Background | backgroundColor | #FFFFFF |
| Primary Button Background | primaryButtonColor | #00326480 |
| Primary Button Background (Pressed) | primaryButtonPressedColor | #003264CC |
| Primary Button Text | primaryButtonTextColor | #FFFFFF |
| Primary Button Text (Pressed) | primaryButtonPressedTextColor | #FFFFFF |
| Primary Button Border | primaryButtonBorderColor | #003264 |
| Primary Button Border (Pressed) | primaryButtonPressedBorderColor | #003264CC |
Examples
Setting a custom title font:
let size: CGFloat = UIFont.preferredFont(forTextStyle: .title3).pointSize
let customFont: UIFont = UIFont(name: "Custom-Font", size: size)
OzoneNFCUIAppearance.shared.titleFont = customFont
Updating the Primary Button background colour:
OzoneNFCUIAppearance.shared.set(.primaryButtonColor, uiColor: .red)