iOS Cordova Wrapper
-
We will be using XCode version 13.3 in this guide. Setup the Cordova development environment based on the development and target OS by following the steps here,
Setting up the development environment Github Repository -
We will be integrating iOS Identity SDK version 9.3.10.2.26. Download and unzip the CordovaSDK2iOSResources archive, it consists of the web_code, ios_code, ios_framework, plugin, plugin_code directories. Please enter the credentials for the Demo environment(URL, Initialize URL, Login ID, Password, Merchant ID) in UserDefaults+IDentitySample.swift.
CordovaSDK2iOSResources -
Create an empty Cordova application
cordova create sdktest com.idmission.sdk.Client IDMissionSDK_Cordova_Client
-
Add web code. Copy and paste the contents of web_code folder to the main project folder. Overwrite files if required.
- Add iOS platform. Execute the following command in the main project folder,
cordova platform add ios
- Add browser plugin.
cordova plugin add cordova-plugin-inappbrowser@5.0.0
- Add Identity SDK plugin.
cordova plugin add ../CordovaSDK2iOSResources/plugin
- In case you encounter doc.find error, after Step 11, please copy and overwrite the file present in platform/ios, platform/ios/www, platform/ios/platform_www folders from plugin_code here.
- Build Cordova application.
cordova build ios
- Add iOS code. Navigate to /platforms/ios/SdkTest/Classes directory. Replace “IDMissionSDK_Cordova_Client” with project name in case you are using a different project name. Overwrite the three files from ios_code here.
- Modify pod file. Navigate to /platforms/ios directory. Change pod 'TensorFlowLiteSwift' to pod 'TensorFlowLiteSwift', '~> 2.7.0'
- Install pods. Navigate to the iOS directory. Uninstall pods.
pod deintegrate
- Delete Podfile.lock and IDMExpo.xcworkspace files. Replace the Podfile with the Podfile from ExpoSDK2iOSResources archive. Install pods.
pod install
- Launch IDMissionSDK_Cordova_Client.xcworkspace.
- Add iOS dependencies. Drag and drop the IDCapture_Swift.framework, IDentitySDK_Swift.framework, SelfieCapture_Swift.framework present in the ios_framework directory into the Frameworks directory in XCode. In the popup, “Copy items if needed”, “Create groups” and “IDMissionSDK_Cordova_Client” target should be selected. Select the Target, then select General, Framework, Libraries and Embedded Content, and select the Embed & Sign option for IDCapture_Swift.xcframework, IDentitySDK_Swift.xcframework, SelfieCapture_Swift.xcframework.
- Code signing. Select the Target, then select Signing & Capabilities. Add Team and Provisioning Profile
- Build and run the application from XCode. The web code can be debugged in Safari developer console.
- Cordova sample app TestFlight link
- Here is a brief description of the sample app functionality,
- ID Validation - Initiates ID Validation(Service ID 20) flow.
- ID Validation and Match Face - Initiates ID Validation and Match Face(Service ID 10) flow.
- ID Validation and Customer Enroll - Initiates ID Validation and Customer Enroll(Service ID 50) flow.
- Customer Enroll Biometrics - Initiates Customer Enroll Biometrics(Service ID 175) flow.
- Customer Verification - Initiates Customer Verification(Service ID 105) flow.
- Identify Customer - Initiates Identify Customer(Service ID 185) flow.
- Live Face Check - Initiates Live Face Check(Service ID 660) flow.
- Submit - Submits the form.