In Android Studio, open the app directory (which can also be labeled Module: app) and then open the build.gradle file. Double-check to make sure that you edit the Gradle file that is located in the app directory. Add the following contents to the Gradle file. Code Block |
---|
| repositories {
...
maven {
url "https://cardinalcommerce.bintray.com/android"
credentials {
username ''//Bintray username
password ''//Bintray user API Key
}
}
}
dependencies {
...
//Cardinal Mobile SDK
implementation 'org.jfrog.cardinalcommerce.gradle:cardinalmobilesdk:2.2.1-12'
// Required libraries
implementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: '7.0.1'
implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.61'
} |
Info |
---|
For Bintray username and API Key please reach out to your client manager. |
Upon successfully completing Integration in Step 1, get the instance of the cardinal object by Cardinal.getInstance(). SDK offers multiple configuration options for you (if not specified, everything is set to default). For more details: CardinalConfigurationOptions. Use the code snippet below for completing the cardinal.configure(). Code Block |
---|
language | java |
---|
theme | Emacs |
---|
title | Java |
---|
| private Cardinal cardinal = Cardinal.getInstance();
@Override
protected void onCreate(Bundle savedInstanceState) {
CardinalConfigurationParameters cardinalConfigurationParameters = new CardinalConfigurationParameters();
cardinalConfigurationParameters.setEnvironment(CardinalEnvironment.STAGING);
cardinalConfigurationParameters.setRequestTimeout(8000);
cardinalConfigurationParameters.setChallengeTimeout(5);
JSONArray rType = new JSONArray();
rType.put(CardinalRenderType.OTP);
rType.put(CardinalRenderType.SINGLE_SELECT);
rType.put(CardinalRenderType.MULTI_SELECT);
rType.put(CardinalRenderType.OOB);
rType.put(CardinalRenderType.HTML);
cardinalConfigurationParameters.setRenderType(rType);
cardinalConfigurationParameters.setUiType(CardinalUiType.BOTH);
UiCustomization yourUICustomizationObject = new UiCustomization();
cardinalConfigurationParameters.setUICustomization(yourUICustomizationObject);
cardinal.configure(this,cardinalConfigurationParameters);
} |
Code Block |
---|
language | java |
---|
theme | Emacs |
---|
title | Kotlin |
---|
collapse | true |
---|
| private val cardinal: Cardinal = Cardinal.getInstance()
override fun onCreate(savedInstanceState: Bundle?) {
val cardinalConfigurationParameters = CardinalConfigurationParameters()
cardinalConfigurationParameters.environment = CardinalEnvironment.STAGING
cardinalConfigurationParameters.requestTimeout = 8000
cardinalConfigurationParameters.challengeTimeout = 5
val rTYPE = JSONArray()
rTYPE.put(CardinalRenderType.OTP)
rTYPE.put(CardinalRenderType.SINGLE_SELECT)
rTYPE.put(CardinalRenderType.MULTI_SELECT)
rTYPE.put(CardinalRenderType.OOB)
rTYPE.put(CardinalRenderType.HTML)
cardinalConfigurationParameters.renderType = rTYPE
cardinalConfigurationParameters.uiType = CardinalUiType.BOTH
val yourUICustomizationObject = UiCustomization()
cardinalConfigurationParameters.uiCustomization = yourUICustomizationObject
cardinal.configure(this, cardinalConfigurationParameters)
} |
Info |
---|
| After you configure cardinalSession, call method getWarnings to get the list of all the warnings for the particular device. Take further action based on the warnings found. List of warnings can be accessed as follows: List<Warning> warnings = cardinal.getWarnings(); Goto Security Guidance for detail. |
|