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.
- Add frameworks files. Copy and paste the contents of the frameworks folder to the ios folder and example\ios\Runner folder.
- 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. If prompted for creating bridging header, decline the prompt.
- Add app dependencies. Navigate to example/ios/Runner folder. Drag and drop the IDCapture_Swift.xcframework, IDentitySDK_Swift.xcframework, SelfieCapture_Swift.xcframework to Runner/Frameworks directory in XCode. In the popup, “Copy items if needed”, “Create groups” and Runner target should be selected. Select the Runner 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.
- 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. Add plugin dependencies. Navigate to ios folder. Drag and drop the IDCapture_Swift.xcframework, IDentitySDK_Swift.xcframework, SelfieCapture_Swift.xcframework to Pods/Frameworks directory in XCode. In the popup, “Copy items if needed”, “Create groups” and flutter_plugin_identity_sdk target should be selected.
- Code signing. Select the Runner Target, then select Signing & Capabilities. Add Team and Provisioning Profile
- Build and run the code on an iOS device.
- Flutter sample app Download link
- Here is a brief description of the sample app functionality,
- 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.