iOS Flutter Wrapper
-
Setup the Flutter development environment based on the development and target OS by following the steps here,
Setting up the development environment -
Install cocoapods-user-defined-build-types plugin. Do not use system Ruby installation to install the plugin.
Cocoapods Plugin Ruby Instructions
-
Verify that all the Flutter dependencies are installed correctly,
flutter doctor
-
Download and unzip the resources archive,
FlutterSDK2iOSResources -
Run the following commands in your working directory to create the plugin template:
flutter create --template=plugin --org com.idmission.newsdkflutter --platforms=android,ios -a java -i swift flutter_plugin_identity_sdk
cd flutter_plugin_identity_sdk
cd example
flutter pub upgrade
dart migrate --apply-changes
- Add flutter dart code. From the flutter_dart_code folder, copy and paste the 3 dart files to the lib folder. Overwrite file if required.
- Add flutter dart project code. From the flutter_dart_project_code folder, copy and paste main.dart to the example/lib folder. Overwrite file if required.
- Add podspec and Podfile. From the podspec folder, copy and paste the file to the ios folder. From the podfile folder, copy and paste the file to the example/ios folder. Overwrite file if required.
- Setup pods. Navigate to the example/ios directory in Terminal. Execute the command mentioned below to uninstall the pods.
pod deintegrate
- Delete Podfile.lock and Runner.xcworkspace files in example/ios folder. Replace the Podfile with the Podfile from podfile folder. Execute the command mentioned below to install pods.
pod install
- Add permissions file. Copy and paste the contents of the permissions folder to the example\ios\Runner folder. Overwrite file if required.
- Open app project in XCode. Launch Runner.xcworkspace in example/ios folder.
- Add iOS code. In the project navigator in Xcode, navigate to Pods/Development Pods/flutter_plugin_identity_sdk/.../../example/ios/.symlinks/plugins/flutter_plugin_identity_sdk/ios/Classes. Delete FlutterPluginIdentitySdkPlugin.swift file from Classes folder. Drag and drop the contents of ios_code folder into this Classes folder in XCode. In the popup, “Copy items if needed”, “Create groups” and flutter_plugin_identity_sdk target should be selected.
- Select the Runner Target, then select Build Phases, Run Script. Add the following code in the second line of the shell script,
find "$BUILD_DIR" -type f -name "*.signature" -exec rm {} \;
- Close XCode. Navigate to the example/ios directory in Terminal. Execute the command mentioned below to uninstall the pods.
pod deintegrate
- Delete Podfile.lock and Runner.xcworkspace files in example/ios folder. Execute the command mentioned below to install pods.
pod install
- Launch Runner.xcworkspace in example/ios folder.
- Code signing. Select the Runner Target, then select Signing & Capabilities. Add Team and Provisioning Profile
- Build and run the code on an iOS device.
- Initialize - Initializes the SDK.
- ID Validation - Initiates ID Validation(Service ID 20) flow.
- ID Validation and Match Face - Initiates ID Validation and Match Face(Service ID 10) flow.
- Identify Customer - Initiates Identify Customer(Service ID 185) flow.
- Live Face Check - Initiates Live Face Check(Service ID 660) 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.
- Submit Result - Submits the form.
Available Functions
idm_sdk_init(String apiBaseUrl, String debug, String accessToken)
idm_sdk_serviceID20()
idm_sdk_serviceID10()
idm_sdk_serviceID185()
idm_sdk_serviceID660()
idm_sdk_serviceID50(int uniqueCustomerNumber)
idm_sdk_serviceID175(int uniqueCustomerNumber)
idm_sdk_serviceID105(int uniqueCustomerNumber)
submit_result()