Step 1 - Download and Import the Cardinal Mobile SDK
Download the CardinalMobile.framework/CardinalMobile.xcframework file using the following cURL.:
Download cURL
Code Block | ||
---|---|---|
| ||
curl -L -u <USER_NAME> :<API_KEY> https://cardinalcommerceprod.jfrog.io/artifactory/ios/<VERSION>-<BUILD_NUMBER>/cardinalmobilesdk.zip -o <LOCAL_FILE_NAME.EXT> #Example: curl -L -u UserName:ApiKey "https://cardinalcommerceprod.jfrog.io/artifactory/ios/2.2.5-1/cardinalmobilesdk.zip" -o cardinalmobile2.2.5-1.zip |
Download .xcframework Using cURL
Code Block | ||
---|---|---|
| ||
curl -L -u <USER_NAME> :<API_KEY> https://cardinalcommerceprod.jfrog.io/artifactory/ios/<VERSION>-<BUILD_NUMBER>/CardinalMobileiOSXC.zip -o <LOCAL_FILE_NAME.EXT> #Example: curl -L -u UserName:ApiKey "https://cardinalcommerceprod.jfrog.io/artifactory/ios/2.2.5-1/CardinalMobileiOSXC.zip" -o cardinalmobile2.2.5-1.zip |
In your XCode project, drag the CardinalMobile.framework or CardinalMobile.xcframework file into the Frameworks group in your Xcode Project (create the group if it doesn't already exist). In the Import dialog, tick the box to Copy items into destinations group folder (or Destination: Copy items if needed). The iOS SDK files are now available for linking to your project. |
Info |
---|
If you do not previously have a JFrog Platform Username and API Key, please reach out to your CardinalCommerce Solution Engineer. |
Step 2 - Setting Up Your Build Environment
Open Xcode and click on your project in the source list to the left of the main editor area.
Select your application under the Targets section and go to the General tab.
Expand the Embedded Binaries section then click the small “+” button at the bottom of the list.
Add the CardinalMobile.framework or CardinalMobile.xcframework file from the list
Step 3 - Configure Cardinal Mobile SDK
Upon successfully completing Integration in Step 1 and Step 2, create a new instance of the cardinal object by [CardinalSession new]. 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 configuration.
Objective C
Code Block | ||
---|---|---|
| ||
#import <CardinalMobile/CardinalMobile.h> CardinalSession *session; //Setup can be called in viewDidLoad - (void)setupCardinalSession { session = [CardinalSession new]; CardinalSessionConfiguration *config = [CardinalSessionConfiguration new]; config.deploymentEnvironment = CardinalSessionEnvironmentProduction; config.requestTimeout = CardinalSessionTimeoutStandard; config.challengeTimeout = 85; config.uiType = CardinalSessionUITypeBoth; UiCustomization *yourCustomUi = [[UiCustomization alloc] init]; //Set various customizations here. See "iOS UI Customization" documentation for detail. config.uiCustomization = yourCustomUi; UiCustomization *yourDarkModeCustomUi = [[UiCustomization alloc] init]; config.darkModeUiCustomization = yourDarkModeCustomUi; CardinalSessionRenderTypeArray *renderType = [[CardinalSessionRenderTypeArray alloc] initWithObjects: CardinalSessionRenderTypeOTP, CardinalSessionRenderTypeHTML, CardinalSessionRenderTypeOOB, CardinalSessionRenderTypeSingleSelect, CardinalSessionRenderTypeMultiSelect, nil]; config.renderType = renderType; [session configure:config]; } |
Swift
Code Block | ||
---|---|---|
| ||
import CardinalMobile var session : CardinalSession! //Setup can be called in viewDidLoad func setupCardinalSession{ session = CardinalSession() var config = CardinalSessionConfiguration() config.deploymentEnvironment = .production config.requestTimeout = 8000 config.challengeTimeout = 85 config.uiType = .both let yourCustomUi = UiCustomization() //Set various customizations here. See "iOS UI Customization" documentation for detail. config.uiCustomization = yourCustomUi let yourDarkModeCustomUi = UiCustomization() config.uiCustomization = yourDarkModeCustomUi config.renderType = [CardinalSessionRenderTypeOTP, CardinalSessionRenderTypeHTML, CardinalSessionRenderTypeOOB, CardinalSessionRenderTypeSingleSelect, CardinalSessionRenderTypeMultiSelect] session.configure(config) } |
Info |
---|
Security GuideAfter you configure you configure cardinalSession, call method getWarnings to call method
Goto See our iOS Security Guidance for detail. |
Available Configurations
Anchor | ||||
---|---|---|---|---|
|
Method | Description | Default Values | Possible Values | ||||
---|---|---|---|---|---|---|---|
deploymentEnvironment | The environment SDK connects to. | CardinalSessionEnvironmentProduction |
| ||||
collectLogs | Enables collecting SDK logs | true | Boolean | ||||
requestTimeout | Sets the maximum amount of time (in milliseconds) for all exchanges | 8000 | Milliseconds | ||||
challengeTimeout | Challenge Screen Timeout in Minutes. | 5 | Greater than or equal to 5 Minutes. | ||||
uiType | Interface types that the device supports for displaying specific challenge user interfaces within the SDK. This setting interacts with renderType in important ways. See renderType below for more information. | CardinalSessionUITypeBoth
|
| ||||
renderType | List of all the RenderTypes that the device supports for displaying specific challenge user interfaces within the SDK. Note:
See uiType above for more information on which UiType to use. |
|
| ||||
proxyServerURL | Proxy server through which the Cardinal SDK Session operates. | nil | String Value |
|
|
|
|
requestTimeout | Sets the maximum amount of time (in milliseconds) for all exchanges | 8000 | >=0 Milliseconds (Integer) | ||||
challengeTimeout | Challenge Screen Timeout in Minutes. | 5 | >=5 minutes (Integer) | ||||
uiCustomization | Set Custom UICustomization for SDK Controlled Challenge UI. | nil | |||||
enableDFSync | Enable DF Sync to get onSetupCompleted (Step 4) called after collected Device Data is sent to the server. | true | Boolean | ||||
threeDSRequestorAppURL | Merchant app declaring their URL within the CReq message so that the Authentication app can call the Merchant app after OOB authentication has occurred. Each transaction would require a unique Transaction ID by using the SDK Transaction ID.nil | String Value | |||||
collectLogs | Enables collecting SDK logs | true | Boolean | ||||
|
|
|
| ||||
darkModeUiCustomization | Set Custom UICustomization for SDK Controlled Challenge UI.nil | - |