Customization
See Theme for additional info about customizing.
CustomerJourneyConfig.Builder
Included here are all the available settings for the CustomerJourneyConfig builder:
/**
* Builder for Customer Journey Configuration, this is used to lower Intent extras.
*/
@Keep
data class Builder(
baseUrl: String,
credentials: Credentials
) {
/**
* Base Link for IEOS server. https://your-prefix.idscan.cloud
*/
fun setBaseUrl(baseUrl: String) = apply { this.baseUrl = baseUrl }
/**
* Credentials for Upload and get Journey results.
*/
fun setCredentials(credentials: Credentials) = apply { this.credentials = credentials }
/**
* Will override credentials with token, [setCredentials] and [setToken] will override each oder in order.
*/
fun setToken(token: String) = apply { this.credentials = Credentials().setToken(token) }
/**
* Allows providing list of [com.gbgroup.idscan.bento.enterprice.data.Certificate], by default it will be empty list.
*/
fun setCertificates(certificates: List<Certificate>) =
apply { this.certificates = certificates }
/**
* Sets journey definition ID.
*/
fun setJourneyDefinitionId(id: String) = apply { this.journeyDefinitionId = id }
/**
* Allows to set configuration for Document Scanning process
*
* @param config The [QualityCheckConfig] set as required
*/
fun setDocumentScannerConfig(config: DocumentScannerConfig) = apply {
this.documentScannerConfig = config
}
/**
* Set journeyId with random GUID string in case you would like for the backend to generate the journey with the specified value
* In case of invalid GUID, the backend will generate a random string
* @param journeyId The [String] GUID, ex c2a9de7d-1f26-4bea-bab1-27f74a00f917
*/
fun setJourneyId(journeyId: String) = apply {
this.journeyId = journeyId
}
/**
* Sets the activity's window background to be translucent, so that the underlying content behind the activity would be visible.
* This could be used, when you want to inject custom UI, which is either a bottom sheet or a dialog. This has limited testing/support on modern versions of Android. This may be replaced with alternative customization options in a future version.
*
* !!! Warning !!!
* Keep in mind that there are subtle differences between the lifecycle of a translucent activity and a normal activity.
* For example, the background activity is never stopped, only paused, so that it can continue receiving UI updates.
* Please refer to the official Android documentation for more information.
*
* @param isTranslucent value indicating if the activity should be translucent
*/
fun setIsTranslucentActivity(isTranslucent: Boolean) = apply {
this.isTranslucentActivity = isTranslucent
}
/**
* The connect/read/write network timeout, in seconds, used for journey API calls.
* Defaults to 60 seconds.
* A timeout of zero or lower means NO TIMEOUT on the client.
* Be aware that longer client timeouts may be capped by the server side timeout.
*/
fun setNetworkTimeoutSeconds(seconds: Long) = apply {
this.networkTimeoutSeconds = seconds
}
/**
* Build [CustomerJourneyConfig]
*/
fun build(): CustomerJourneyConfig {
return CustomerJourneyConfig(
baseUrl,
credentials,
certificates,
journeyDefinitionId,
documentScannerConfig,
journeyId,
isTranslucentActivity,
networkTimeoutSeconds
)
}
}
DocumentScannerConfig.Builder
Included here are all the available settings for the DocumentScannerConfig builder:
/**
* Builder for Document Scanner Configuration.
*/
@Keep
data class Builder(
manualCaptureAppearTime: Long = 15000,
manualCaptureDisabled: Boolean = false,
enableScreenshots: Boolean = false
) {
/**
* Allows to control after how long manual capture mode should become visible
*
* @param appearTime The [Long] set as required
*/
fun setManualCaptureAppearTime(appearTime: Long)
/**
* Allows to disable manual capture mode
*
* @param disabled The [Boolean] set as required
*/
fun setManualCaptureDisabled(disabled: Boolean)
/**
* Enables screenshotting. Screenshots are disabled by default.
*
* @param enable The [Boolean] set as required
*/
fun setEnableScreenshots(enable: Boolean)
/**
* Builds the object
*/
fun build()
}
Language Override
MJCS supports overriding the language with the following methods. MJCS does not ship with any non-english language localization, so if you intend to do this, make sure you also localize MJCS
object MJCS {
/**
* Overrides device language and sets the selected language throughout MJCS
* as long as the translated strings have been added to the strings.xml
*
* @param context current context
* @param language An ISO 639 alpha-2 or alpha-3 language code, or a language subtag
* up to 8 characters in length. See the <code>Locale</code> class description about
* valid language values.
*/
@JvmStatic
fun setLanguage(context: Context, language: String)
/**
* Either enables or disables overriding the device language with selected language
* for MJCS.
*
* @param context current context
* @param enabled boolean to either enable or disable overriding device language
*/
@JvmStatic
fun setLanguageSelectionEnabled(context: Context, enabled: Boolean)
}
Localization
Localization keys for MJCS are listed below. Not every key gets used for every journey, but it is easiest to localize all of them rather than trying to pick and chose only the ones used in your journey.
In addition to the keys listed here, since MJCS uses the SmartCapture Components, you should also localize all of the strings for the SmartCapture components that can appear in your journey.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="MJCS_datachecks_address_title">Enter your address</string>
<string name="MJCS_datachecks_address_line_1">House Name/Number*</string>
<string name="MJCS_datachecks_address_line_2">Street Name*</string>
<string name="MJCS_datachecks_address_city">City*</string>
<string name="MJCS_datachecks_address_postcode">Postcode*</string>
<string name="MJCS_datachecks_address_postcode_support">5 or more characters with no spaces, e.g. CH49GB</string>
<string name="MJCS_datachecks_address_country">Country*</string>
<string name="MJCS_datachecks_continue_button">Continue</string>
<string name="MJCS_datachecks_fix_errors">Please fix the errors and try again</string>
<string name="MJCS_cancel_body">Are you sure you wish to cancel the journey?</string>
<string name="MJCS_cancel_yes">Cancel journey</string>
<string name="MJCS_cancel_no">Return to journey</string>
<string name="MJCS_retry_doc_title">We couldn\'t verify your document</string>
<string name="MJCS_retry_face_title">We couldn\'t verify your selfie</string>
<string name="MJCS_retry_nfc_title">We couldn\'t verify your document\'s chip</string>
<string name="MJCS_retry_misc_title">An error occurred\nplease retry</string>
<string name="MJCS_retry_button">Try Again</string>
<string name="MJCS_retry_last_attempt">Last Attempt</string>
<string name="MJCS_retry_doc_subtitle">Try again</string>
<string name="MJCS_retry_doc_not_accepted_title">Your identity document is not accepted</string>
<string name="MJCS_retry_doc_not_accepted_subtitle">Try again with a different document</string>
<string name="MJCS_retry_doc_not_supported_title">Your photo could not be identified</string>
<string name="MJCS_retry_doc_not_supported_subtitle">This might be due to a quality issue, or we couldn\'t identify the ID</string>
<string name="MJCS_retry_doc_expired_title">Your identity document is expired</string>
<string name="MJCS_retry_doc_expired_subtitle">Try again with a valid document</string>
<string name="MJCS_retry_position_doc">Make sure to position your valid government issued identity document to fill the entire frame on your screen</string>
<string name="MJCS_retry_end_identity_check">End Identity Check</string>
<string name="MJCS_processing_document">Sit tight, we are checking your Identity Document</string>
<string name="MJCS_processing_face">Sit tight, we are checking your Selfie</string>
<string name="MJCS_processing_poa">Sit tight, we are checking your Proof of Address</string>
<string name="MJCS_processing_address">Sit tight, we are checking your Address</string>
</resources>