VISA Concierge Android SDK
Version: 1.4.1
Min Android SDK: 21 (build version), 24 (supported version)
Theme: light, dark
Orientations: portrait, landscape
Languages: en, ru, kk
Minimum Android SDK Version Notice
This SDK has been tested and supports Android API level 24 and above. To allow integration into projects targeting lower API levels, the SDK’s internal minSdkVersion is set to 21.
Developers are strongly advised to check the minimum supported Android version on the client side and hide or disable any sections of the application that use the SDK for users on devices running below API 24.
If this check is not implemented, the SDK will still enforce it by:
Displaying a warning message to the user.
Terminating its execution and closing.
Configure dependency
To get the dependency, you first need to configure access to our repository.
Install AWS CLI using this guide.
Configure AWS CLI using the credentials provided by us. To do this, run the following command in your terminal.
aws configure
# After executing the command, you will be prompted to enter the following information
AWS Access Key ID [None]: <YOUR_ACCESS_KEY>
AWS Secret Access Key [None]: <YOUR_SECRET_KEY>
Default region name [None]: eu-central-1
Default output format [None]: jsonAdd this configuration into the
repositoriesblock in your project'sbuild.gradle|settings.gradlefile.
maven {
url = "https://infocus-346627266603.d.codeartifact.eu-central-1.amazonaws.com/maven/concierge-sdk/"
credentials {
username = "aws"
// This script will obtain the authorization token using AWS CLI
def command = "aws codeartifact get-authorization-token --domain infocus --domain-owner 346627266603 --region eu-central-1 --query authorizationToken --output text"
def process = command.execute()
process.waitFor()
def token = process.text.trim()
password = token
}
}Add the dependency on the SDK to the project's
build.gradlefile in thedependenciesblock.
implementation("com.visa.concierge:concierge-android-sdk:<preferred_version>")The SDK uses some Java 8 APIs that are not available in Android SDK 24, so to enable devices with lower Android versions to u SDKse the, desugaring must be enabled. More detaist can be found here https://developer.android.com/studio/write/java8-support#library-desugaring
android { ... compileOptions { ... isCoreLibraryDesugaringEnabled = true } } dependencies { ... coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:<latest_version>") }
Auth
The SDK is available only to authenticated users.
To start the authorization process, you need to implement the functional interface com.visa.concierge.auth.CredentialsProvider. The output of the implementation method of this interface should be a class implementing the interface com.visa.concierge.auth.Credentials. Currently, only one authentication method is available - using the client token. To obtain this token, your backend must have the appropriate API. In the implementation of the functional interface, you need to implement the logic for retrieving this token from your backend and passing it to the SDK in the appropriate format. To provide this token, you need to use the class com.visa.concierge.auth.ClientCredentials.
com.visa.concierge.auth.ClientCredentials has 2 parameters in the constructor:
token- user tokenneedRequestUserPhone- a flag indicating the necessity to request the user's phone number on the first SDK launch. If the flag istrue- on first launch SDK will open an activation flow to request and activate the user's phone number, iffalse- it won't (by default, in the constructor with one parameter, this flag isfalse).
EncryptedSharedPreferences are encrypted with a unique device-bound key, so they need to be excluded from automatic backups. To do this, you need to:
In your AndroidManifest.xml file add attributes.
<application ... android:fullBackupContent="@xml/backup_rules" android:dataExtractionRules="@xml/data_extraction_rules"> </application>Create an XML file called
backup_rules.xmlin theres/xml/directory with following content.<?xml version="1.0" encoding="utf-8"?> <full-backup-content> <exclude domain="sharedpref" path="concierge_sdk_enc_prefs.xml"/> </full-backup-content>Create an XML file called
data_extraction_rules.xmlin theres/xml/directory with following content.<data-extraction-rules> <cloud-backup> <exclude domain="sharedpref" path="concierge_sdk_enc_prefs.xml"/> </cloud-backup> <device-transfer> <exclude domain="sharedpref" path="concierge_sdk_enc_prefs.xml"/> </device-transfer> </data-extraction-rules>
Setup and Init SDK
Sdk must be initialized before the first usage of UI components. This could be done in the Application class of your app.
Example of initialization
class MyApplicationKt : Application() {
override fun onCreate() {
super.onCreate()
...
// initialize SDK here
ConciergeSdk.init(
applicationContext = applicationContext,
// functional interface for passing SDK credentials
credentialsProvider = {
// client token retrieval logic should be placed here
//
// this method will be called from background thread,
// so you could safely perform API call here
val response = yourBackendApi.getClientToken()
ClientCredentials(token = response.clientToken)
},
config = conciergeConfig { configBuilder ->
configBuilder
// enable console logging
.isDebugEnabled(true)
// customize global screen background
.backgroundTheme { bgTheme ->
bgTheme
.color(
light = Color.WHITE,
dark = Color.GRAY
)
}
// customize chat theme
.chatScreenTheme { chatTheme ->
chatTheme
//customize info screen theme
.infoScreenTheme { infoTheme ->
infoTheme
// setup your logo icon for info screen
.vendorLogo(
light = R.drawable.ic_bank_logo,
dark = R.drawable.ic_bank_logo
)
...
}
// customize client message theme
.clientMessageTheme { messageTheme ->
messageTheme
.backgroundTint(
light = applicationContext.getColor(R.color.white),
dark = applicationContext.getColor(R.color.black)
)
...
}
}
...
}
)
...
}
}Configuration and Theming
All configuration and theme settings of the SDK are done using com.visa.concierge.ConciergeConfig.Builder. All themes are divided into two parts - dark and light. Switching between them occurs automatically following the dark-light mode of the operating system.
The tint of elements with dynamic colors is set using com.visa.concierge.ui.theme.TintStateList. This class has static methods that allow you to set the color for a specific state. Currently, there are 3 states:
normal - color in the normal state
disabled - color in the disabled state
checked - color in the selected state
Each screen, element, or group of elements can have individually customized fonts. The following parameters are available for font customization:
fontFamily - class that holds a list of font families
fontSize - font size
fontWeight - font weight from the specified family
lineHeight - paragraph height
letterSpacing - spacing between characters
Language Handling Notice.
The SDK does not provide any public API for setting the language manually.
It fully relies on Android’s standard localization mechanism and automatically adapts to the system language or the application language defined by the app’s Context.
If your app supports language switching through the standard Android Context methods, the SDK will follow it automatically.
However, if your app uses a custom localization system that bypasses Android’s standard behavior, you must also update the locale using the official Android approach (by applying the locale through the application Context) to ensure the SDK is properly localized.
Theme elements
isDebugEnabled
enable/disable console logging
backgroundTheme
global screen background theme
topBarTheme
toolbar theme
navBarTheme
navigation bar theme
inputTheme
global input theme
progressIndicatorTheme
global progress indicator theme
ratingBarTheme
global rating bar theme
textTheme
global text theme
rippleTheme
global ripple theme
cardTheme
global card component theme
filledTextButtonTheme
global filled text button theme
outlinedTextButtonTheme
global outlined text button theme
filledIconButtonTheme
global filled icon button theme
infoDialogTheme
global info dialog theme
chatScreenTheme
chat screen theme
requestListScreenTheme
requests list screen theme
Background theme
color
background color
TopBar theme
backgroundColor
background color
buttonTint
button tint color
NavigationBar theme
backgroundColor
background color
buttonTint
button tint color
indicatorColor
accent background color of selected icon
Input theme
cursorColor
cursor color
textHighlight
selected text highlight color
ProgressIndicator theme
color
indicator background color
trackColor
indicator track color
StepIndicator theme
stepTint
step color tint
doneIconColor
color of done icon for last step
RatingBar theme
selectedColor
color that represents the selected or "filled" part of the rating
unselectedColor
color that represents the unselected or "empty" part of the rating
Text theme
color
text color
Ripple theme
color
ripple color
alpha
ripple alpha
Card theme
backgroundColor
background color
contentColor
content color
Button theme
backgroundTint
background color
contentTint
content color
SingleActionDialog theme
backgroundColor
background color
confirmButtonTheme
confirm button theme
ChatScreen theme
infoScreenTheme
info screen theme
clientMessageTheme
client message theme
managerMessageTheme
manager message theme
dateSeparatorTheme
date separator theme
inputTheme
chat input theme
InfoScreen theme
logoBackground
logog background color
logoTint
logo tint color
vendorLogo
vendor logo icon resource
vendorLogoTintEnabled
enable/disable tint of vendor logo
Message theme
backgroundTint
background color
fileTheme
message file theme
textColor
text color
dateColor
date text color
avatarBackgroundTint
avatar background color
avatarContentTint
avatar content color
MessageFile theme
backgroundTint
background color
contentTint
tint of file icon/name
DateSeparator theme
backgroundTint
background color
textColor
text color
ChatInput theme
backgroundTint
background color
textTint
text color
emojiButtonTheme
emoji popup theme
sendButtonTheme
send button theme
attachButtonTheme
attach button theme
emojiPopupTheme
emoji button theme
attachDialogTheme
attach dialog theme
attachedItemTheme
attached item theme
EmojiPopup theme
backgroundTint
background color
buttonTint
button tint color
dividerTint
divider color
AttachDialog theme
backgroundTint
background color
buttonTint
button tint color
dividerTint
divider color
AttachedItem theme
backgroundTint
background color
contentTint
tint color of icon/text
cancelButtonTheme
cancell button theme
RequestListScreen theme
requestViewTheme
request card view theme
RequestView theme
backgroundColor
background color
unseenBadgeColor
unseen progress badge background color
unseenBadgeTextColor
unseen progress badge text color
titleTint
title color
dateTint
request creation date color
requestProgressTheme
request step indicator theme
Usage
There are 3 ways to integrate the SDK into your application:
Activity - using
com.visa.concierge.ui.ConciergeActivity. This activity needs to be registered in your application's manifest.Fragment - using
com.visa.concierge.ui.ConciergeFragment.Compose - using
com.visa.concierge.ui.ConciergeEntryPoint().
For any of these methods, you will only need to define the navigation from your application to the SDK's entry point, and that's it.
Last updated