Cordova

This is a guide to implement Incode in the Apache Cordova

Requirements

Cordova development environment setup

Apache Cordova

Supported Android Version:

API 21+ & CompileSDK version 31.

Supported iOS Version

iOS 13+

Plugin installation

Install the Incode Cordova plugin in your app using the following command:

cordova plugin add https://github.com/Incode-Technologies-Example-Repos/incode-cordova-plugin.git

To enable the camera to capture ID and face, use the following command:

cordova plugin add cordova-plugin-camera

To enable the use of GeoLocation if it is required, use the following command:

cordova plugin add cordova-plugin-geolocation

Additional Setup for iOS

  1. Open your .xcworkspace project on XCODE
  2. Set your Team Develop in Targets > Sign & Capabilities. (if you don't have it)
  3. Ensure that you have set up at least swift version 5: Targets > Build Settings > Swift Compiler - Language
  4. Change your Podfile so it requires deployment target 13 or higher.
platform :ios, '13.0'
  1. Run 'pod install'
Run "pod install" under ios folder

Troubleshooting

iOS: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation

Solution

Run the commands below:

cordova platform remove ios
cordova platform add ios
cd platforms/ios && pod install --repo-update
pod repo update

iOS:Error: Failed to fetch platform cordova-ios using cordova platform add ios

Solution

Run the command:

npm update -g

Android: Attribute uses-permission#android.permission.WRITE_EXTERNAL_STORAGE@maxSdkVersion value=(32) from AndroidManifest.xml

Solution

add 'tools:replace="android:maxSdkVersion"' to <uses-permission> element at AndroidManifest. Example:

<uses-permission android:maxSdkVersion="32" android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:replace="android:maxSdkVersion" />