iOS Expo Wrapper
-
We will be using XCode version 13.3 in this guide. Setup the Expo development environment based on the development and target OS by following the steps here,
Setting up the development environment Github Repository -
Install cocoapods-user-defined-build-types plugin. Do not use system Ruby installation to install the plugin.
Cocoapods Plugin Ruby Instructions -
We will be integrating iOS Identity SDK version 9.3.10.2.26. Download and unzip the ExpoSDK2iOSResources archive, it consists of the expo, ios_code, ios_framework, reference directories and a Podfile. Please enter the credentials for the Demo environment(URL, Initialize URL, Login ID, Password, Merchant ID) in Home.js.
ExpoSDK2iOSResources -
Create an empty Expo application
expo init IDMExpo
-
Add Javascript code. Copy and paste the contents of the expo folder to the main project folder. Overwrite files if required.
-
Add Expo dependencies. In package.json change the dependencies node and add resolutions node below it.
"dependencies": {
"expo": "~44.0.0",
"expo-status-bar": "~1.2.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-web": "0.17.1",
"expo-splash-screen": "~0.14.1",
"@react-navigation/native": "^5.8.10",
"@react-navigation/stack": "^5.12.8",
"native-base": "^2.15.0",
"react-native-gesture-handler": "^1.9.0",
"react-native-safe-area-context": "^3.1.9",
"react-native-screens": "^2.16.1",
"react-navigation": "^4.4.4"
},
- Delete node_modules folder. Build Expo application
npm install
- Setup 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
- Add iOS code. Examples are available in the reference directory.
- Modify AppDelegate.m file. Add the following import statement,
#import "MainViewController.h"
In didFinishLaunchingWithOptions function, replace rootViewController statement with,
MainViewController *rootViewController = [MainViewController new];
#import "IDMissionSDK.h"
<key>NSCameraUsageDescription</key>
<string>IDentity SDK asks camera permission to capture ID and Face image</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>IDentity SDK asks location access for knowing the submission location</string>
<key>NSLocationUsageDescription</key>
<string>IDentity SDK asks location access for knowing the submission location</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>IDentity SDK asks location access for knowing the submission location</string>
<key>NSMicrophoneUsageDescription</key>
<string>IDentity SDK asks microphone permission to record users voice</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>IDentity SDK asks photo permission to store images</string>
- Launch IDMExpo.xcworkspace.
- Drag and drop all the files in the ios_code folder in IDMExpo in XCode. In the popup “Copy items if needed”, “Create groups” and “IDMExpo” target should be selected.
- 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 “IDMExpo” 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 ios app on a physical device by executing the following command in Terminal. We do not currently support simulators on iOS.
expo run:ios -d
- Expo sample app TestFlight link
- Here is a brief description of the sample app functionality,
- The initialize API call is executed when the app is launched.
- Keyboard - The keyboard on top is used to type the Unique Customer Number which is required for Service ID 50, 175, 105 flows.
- 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.
- The response for all of the API calls is printed in the console log.