V 2.2.3 : Cardinal Mobile SDK iOS Documentation Overview
- Siddhartha Chikatamalla
Overview
The Cardinal Mobile SDK for iOS makes it easy for you to activate and integrate Cardinal Consumer Authentication (CCA) into your checkout flow. In just a few simple steps, you will be able to create a great user experience for your consumers, while utilizing the benefits of CCA.
Minimum Requirements
- Requires iOS 9 & XCode 8
Prerequisites
Within the Cardinal Mobile SDK ecosystem, authentication between the Merchant and Cardinal is handled via a JWT (JSON Web Token). To initialize the system for processing, a JWT must be generated server-side and passed into the first call in the chain.
Within the JWT, you will need to specify your Org Unit Id, API Key & API Identifier. If you weren't given these values upon registration, please contact your account manager.
For more information on generating a JWT, please see the following instructions:
API Documentation
Cardinal Implementation
This is a simple 6-Step process to get your application up and running 3DS 2.0 transactions, with the option to customize challenge screens using UI Customization.
Link to documentation: Cardinal Implementation with Optional UI Customization
Tutorial and Examples
A Quick Start guide is available to help you set up your build environment and get started with the Cardinal Mobile SDK by leading you through the creation of a simple application that connects to Cardinal. Within the download package, you will also find a demo app with full source code to help get you started.
Links to our demo application can be obtained by reaching out to your Client Manager or Implementation Manager.
Issues
Please report bugs, comments, or concerns to your Cardinal Implementation Manager
Frequently Asked Questions
Yes, CardinalMobileSDK supports both Objective-C as well as Swift. Code snippets of each programming language can be found in the documentation.
No, CardinalMobileSDK does not use any third-party SDK/Library.
Yes, Cardinal Mobile SDK is available in both .framework and .xcframework format. Follow the Setting up Cardinal Mobile SDK guide to download and integrate using xcframework.
Yes, you should choose Embed & Sign when integrating CardinalMobile.xcframework. It adds a copy of the framework into your final bundle while releasing your application.
The downloaded framework file size is >3MB. Once integrated with the app that has bitcode support, it adds 774KB if the app is built for both x86 and x64 architecture.
Cardinal Mobile SDK comes with both device and simulator architectures in it, so merchants can develop, test their application in both simulator and device. Unfortunately, AppStore does not allow publishing applications with simulator architectures in it. To publish the app into AppStore developer must remove unused(simulator) architectures from binary, to achieve this add below run script at the end in your build phases.
Note: This is only applicable when using CardinalMobile.framework (universal binary)
FRAMEWORK_NAME="CardinalMobile" find "$PROJECT_DIR" -name '*.framework' -type d | while read -r FRAMEWORK do PATH_COUNT=$(echo "$FRAMEWORK/" | grep -o '/' | wc -l) FILE_NAME=$(echo $FRAMEWORK | cut -d '/' -f $PATH_COUNT | cut -d '.' -f 1) EXECUTE_FILE="$FRAMEWORK/$FILE_NAME" if [[ "$EXECUTE_FILE" == *"$FRAMEWORK_NAME"* ]]; then echo "Executable framework $EXECUTE_FILE" if $(lipo "$FRAMEWORK/$FILE_NAME" -verify_arch x86_64); then lipo -remove x86_64 $EXECUTE_FILE -o $EXECUTE_FILE lipo -info $EXECUTE_FILE fi if $(lipo "$FRAMEWORK/$FILE_NAME" -verify_arch i386); then lipo -remove i386 $EXECUTE_FILE -o $EXECUTE_FILE lipo -info $EXECUTE_FILE fi fi done
Apple removed arm64 support for simulators with Xcode 12, either remove valid architectures column under user settings or add arm64 to the excluded architectures list, for more information refer to https://developer.apple.com/forums/thread/656509
This error is due to recent changes in Xcode to resolve this follow the steps below:
Under Build Settings - Navigate to Validate Workspace - Change it to YES (By Default it is NO)
The run script that strips out the unused architecture from the SDK should be at the bottom of all “Build Phases” so that it executes after “Embed Frameworks”.
This is mostly because of the presence of simulator components in CardinalMobileSDK, to resolve this add the above run script that strips out the unused architecture from the SDK and it should be at the bottom of all “Build Phases” so that it executes after “Embed Frameworks”. Also, make sure that you select Embed&Sign in your general settings (It is under Target->Genral→Frameworks, Libraries, and Embedded Content→CardinalMobile.framework choose Embed&Sign).
Config FAQs
No, if you are using staging credentials make sure SDK config is set to Staging Environment and switch back to Production Environment when moving to production. SDK is configured to the Production Environment by default.
Yes, you can customize the certain aspect of the Challenge Screen by setting the UICustomization in SDK Config. See iOS UI Customization v2.2.4 for details.
Yes, you can use the custom font file that is registered with the iOS.
Yes, you can set enableDFSync to true in SDK Config to get Setup Completion Handler called after Data Collection is complete. enableDFSync is set to false by default.
Setup/Init FAQs
JWT might be invalid if the credentials in the JWT like OrgUnitID, APIKey, APIIdentifiers are invalid or the JWT has expired. Also, make sure the credentials in the JWT point to the correct environment that SDK is set to in the config.
By default, no. If you want Setup to be successful only after Device Data collection is complete, then enable DF Sync in the SDK Config.
OnValidated handler of the Setup will be called with the corresponding error message.
ProcessBin FAQs
If you start ProcessBin without successful completion of Setup/Init, then ProcessBin cannot be completed. Please check the console log for error details.
Continue FAQs
If the parameter you passed to the continue, like TransactionId or Payload is invalid then, continue will throw an error.
Make sure the ThreeDSVersion of the lookup response matches with what SDK Supports. SDK does not support 1.0 Payload.
After all initial setup, in continue pass a sample payload of various UI Types to test different UI in Challenge Screens. You can get the sample payload for various UI type from your Client Manager or Implementation Manager.
No. It means the authentication failed based on the data user provided.