# iOS SDK customization
# Logging
By default, the SDK outputs messages only for critical events (.error).
You can configure the desired logging level via the logLevel property:
.off— logging disabled..error(default) — critical errors only..warning— warnings and errors..info— informational messages, warnings, and errors..debug— debug messages, informational messages, warnings, and errors..trace— maximum level of detail; all available logs are recorded.
sdk.logLevel = .error
# Log interception
By default, the SDK uses the NSLog function for logging. If required, you can override this behavior and intercept logs using the logHandler closure.
sdk.logHandler { (level, message) in
print(Date(), "[Idensic] \(message)")
}
# Analytics
The SDK collects and sends usage statistics to IDnGO servers. We do not track sensitive data; only general usage information are sent. This includes screen navigation events, interactions with UI elements, and so on.
This data is used exclusively to improve IDnGO. It is not shared with third parties and is not used for advertising.
To disable analytics:
sdk.isAnalyticsEnabled = false
# iOS SDK configuration
# Theme
The theme (theme) allows you to customize the SDK's appearance, including fonts, colors, and images. Theme customization becomes available after the SDK is initialized.
There are two ways to configure the theme:
- Modify individual parameters in the existing theme.
- Create and apply a custom theme based on
CBRTheme.
Changing the background color in the default theme:
sdk.theme.colors.backgroundCommon = .white
Creating and applying a custom theme:
sdk.theme = OwnTheme()
class OwnTheme: CBRTheme {
override init() {
super.init()
colors.backgroundCommon = .white
}
}
For more details, see Theme Settings for iOS SDK.
# Fonts
By default, font sizes automatically adjust to the system font size set in the device settings.
When the SDK starts, it reads the user's preferredContentSizeCategory value and adjusts the fonts accordingly. Any size changes made while the SDK is running will not take effect until the next launch.
The maximum text size is .extraExtraExtraLarge.
Automatic font adjustment can be disabled:
sdk.theme.metrics.respectsPreferredContentSizeCategory = false
# Translations
You can configure the texts used in the SDK in the «Integration» section.
By default, the text language is selected according to the system’s preferred language. You can override this behavior by setting sdk.locale to the desired language. Accepted values follow the forma ru or ru_RU.
Selecting the SDK language according to the device settings:
sdk.locale = Locale.current.identifier
# Text strings
Some text strings are stored locally and are not affected by SDK language settings. For example, if the translation server is unavailable due to no internet connection, local strings will still be displayed.
To modify the strings, use the sdk.strings property.
sdk.strings = [
"sns_oops_network_title": "Oops! Seems like the network is down.",
"sns_oops_network_html": "Please check your internet connection and try again.",
"sns_oops_action_retry": "Try again",
]
Warning:
sdk.locale does not affect text strings set locally, so you need to add translations yourself depending on the user's language.
# Contact methods
Support items define the ways users can contact your support team. By default, an item for sending an email request is automatically created. The support email address can be configured in the «Integration» section.
You can configure support items directly by assigning an array of items to the sdk.supportItems property, or add items individually using the sdk.addSupportItem method.
An item with a URL that opens when tapped:
sdk.addSupportItem { (item) in
item.title = NSLocalizedString("URL Item", comment: "")
item.subtitle = NSLocalizedString("Tap me to open an url", comment: "")
item.icon = UIImage(named: "AppIcon")
item.actionURL = URL(string: "https://google.com")
}
An item that triggers an action when tapped, without using a URL:
sdk.addSupportItem { (item) in
item.title = NSLocalizedString("Callback Item", comment: "")
item.subtitle = NSLocalizedString("Tap me to get callback fired", comment: "")
item.icon = UIImage(named: "AppIcon")
item.actionHandler { (supportVC, item) in
print("[\(item.title)] tapped")
}
}
Each item must have a title (title). The icon (icon), subtitle (subtitle), and action (actionURL or actionHandler) are optional.
If neither actionURL nor actionHandler is provided, tapping the item will have no effect.