{"analyzedAt":"2022-07-15T00:52:10.782Z","collected":{"metadata":{"name":"cordova-plugin-identitycordova","scope":"unscoped","version":"0.4.9","description":"Identity platform plugin for Cordova. This plugin supports liveliness detection, ocr, touchless fingerprint, document scanning and mobile voice biometric","keywords":["ecosystem:cordova","cordova-ios","cordova-android"],"date":"2021-03-22T22:26:09.753Z","author":{"name":"Michael Tarimo"},"publisher":{"username":"mtarimo","email":"mtarimo@aimgroup.co.tz"},"maintainers":[{"username":"mtarimo","email":"mtarimo@aimgroup.co.tz"}],"links":{"npm":"https://www.npmjs.com/package/cordova-plugin-identitycordova"},"license":"ISC","releases":[{"from":"2022-06-15T00:00:00.000Z","to":"2022-07-15T00:00:00.000Z","count":0},{"from":"2022-04-16T00:00:00.000Z","to":"2022-07-15T00:00:00.000Z","count":1},{"from":"2022-01-16T00:00:00.000Z","to":"2022-07-15T00:00:00.000Z","count":1},{"from":"2021-07-15T00:00:00.000Z","to":"2022-07-15T00:00:00.000Z","count":1},{"from":"2020-07-15T00:00:00.000Z","to":"2022-07-15T00:00:00.000Z","count":41}],"readme":"# Identity Cordova Plugin\n\nIdentity Cordova Plugin extends native Android and iOS identity functionalities to Cordova based implementations. The plugin extends the following features;\n\n1. Capturing Portrait with liveliness detection\n2. Capturing Identity Card, match the card with the Portrait captured.\n3. Scan Identity Card and documents using OCR to extract data from it. Document scanned can be from the camera or from image gallery.\n\n  \n\n## 1. Cordova Implementation\n\n### Code Integrate into you Application\nThere could be multiple ways to achieve this same implementation\n\n#### HTML\n\n```sh\n<div style=\"flex-direction: row; padding: 5px\">\n\t<button id=\"showOCRScannerButton\">Scan OCR</button>\n\t<button id=\"captureFace\">Capture Face</button>\n\t<button id=\"captureId\">Capture ID</button>\n</div>\n```\n\n#### Javascript\n\n```sh\nvar app = {\n\tinitialize: function  () {\n\tdocument.addEventListener('deviceready', this.onDeviceReady.bind(this), false)\n},\n\nonDeviceReady: function  () {\n\tthis.receivedEvent('deviceready')\n\tvar DocumentReaderResults = IdentityCordova.DocumentReaderResults\n\tvar Scenario = IdentityCordova.Scenario\n\tvar Enum = IdentityCordova.Enum\n\tdocument.getElementById(\"showOCRScannerButton\").addEventListener(\"click\", scanOCR);\n\tif (window.cordova.platformId == \"android\") {\n\t\tdocument.getElementById(\"captureFace\").addEventListener(\"click\", capturePotraitAndroid);\n\t\tdocument.getElementById(\"captureId\").addEventListener(\"click\", captureIdAndroid);\n\t}\n\treadFile(\"www/identity.license\", function  (license) {\n\tIdentityCordova.loadLicense(license, function  (message) {\n\t\t...\n\t}, function  (error) {\n\t....\n\t});\n});\n\nfunction  scanOCR() {\n\tIdentityCordova.showScanner(function (e) { }, function  (e) { })\n}\n\nfunction  capturePotraitAndroid() {\n\tIdentityCordova.captureSelfie(function (e) { }, function  (e) { })\n}\n\nfunction  captureIdAndroid() {\n\tIdentityCordova.captureID(function (e) { }, function  (e) { })\n}\n\n  \n\nfunction  readFile(path, callback, ...items) {\n\twindow.resolveLocalFileSystemURL(cordova.file.applicationDirectory + path, function  (fileEntry) {\n\t\tfileEntry.file(function (file) {\n\t\t\tvar reader = new FileReader()\n\t\t\treader.onloadend = function  (e) {\n\t\t\t\tcallback(this.result.substring(this.result.indexOf(',') + 1), items)\n\t\t\t}\n\t\t\treader.readAsDataURL(file)\n\t\t})\n\n\t\t}, function  (e) { \n\t\t\tconsole.log(JSON.stringify(e)) \n\t\t})\n\t}\n},\n\nreceivedEvent: function  (id) {\n\tvar parentElement = document.getElementById(id)\n\tvar listeningElement = parentElement.querySelector('.listening')\n\tvar receivedElement = parentElement.querySelector('.received')\n\tlisteningElement.setAttribute('style', 'display:none;')\n\treceivedElement.setAttribute('style', 'display:block;')\n\tconsole.log('Received Event: ' + id)\n},\n}\n\napp.initialize()\n``` \n\n### Install license\n\n1. Get a license from AIM Group. We will need your App package ID to generate the license for you.\n\n2. Create identity.license file under www/ folder. Paste the key provided to this file\n\n<b>Note: </b>The app has to be online for the license to be activated\n\n\n### Install plugins\n\n```\nnpm install -g plugman\n```\n\nNavigate to you project\n\n```sh\n$ cordova plugin add cordova-plugin-file\n```\n\n```sh\n$ cordova plugin add cordova-plugin-device\n```\n\n```sh\n$ cordova plugin add cordova-plugin-identitycordova\n```\n\n```sh\n$ cordova plugin add cordova-plugin-androidx\n```\n\n```sh\n$ cordova plugin add cordova-plugin-androidx-adapter\n```\n\n### Run Android\n\nIf you hava plugman installed, you could use plugman to add the plugin\n\n```sh\n$ plugman install --platform android --project [PATH TO YOUR PROJECT]/platforms/android --plugin cordova-plugin-identitycordova\n```\n\nBuild the project\n\n```sh\n$ cordova build android\n```\n\nRun the project in you android device\n\n```sh\n$ cordova run android --device\n```\n\n### Run IOS\n\n```sh\n$ plugman install --platform ios --project [PATH TO YOUR PROJECT]/platforms/ios --plugin cordova-plugin-identitycordova\n```\n\nBuild the project\n\n```sh\n$ cordova build ios\n```\n\nRun the project in you android device\n\n```sh\n$ cordova run ios --device\n```\n\n## 2. Ionic Implementation\n\n### Code Integrate into you Application\n\nThere could be multiple ways to achieve the same implementation, one way is through Dependency Injection. The following steps use DI\n\n#### Step 1\n\nCreate a provider as follows under /src/providers/identity/\n\n```sh\nimport { Injectable } from '@angular/core';\nimport { Plugin, Cordova, CordovaProperty, CordovaInstance, IonicNativePlugin } from '@ionic-native/core'\n\n@Plugin({\npluginName: \"identitycordova\",\nplugin: \"cordova-plugin-identitycordova\",\npluginRef: \"IdentityCordova\",\nplatforms: ['Android', 'iOS'],\n})\n\n@Injectable()\nexport class IdentityProvider {\n\n\t@Cordova()\n\tcaptureSelfie(arg0: any): Promise<any> {\n\n\t\treturn;\n\t}\n\n\t@Cordova()\n\tcaptureID(arg0: any): Promise<any> {\n\n\t\treturn;\n\t}\n\n\t@Cordova()\n\tocrScan(arg0: any): Promise<any> {\n\n\t\treturn;\n\t}\n\n\t@Cordova()\n\tupload(jobInfo: any, partnerParams: any, userIdInfo: any, sidNetInfo: any): Promise<any> {\n\n\t\treturn;\n\t}\n}\n```\n\n  \n\n<b>Note for Ionic 5: </b>Decorators seems to not be working in Ionic 5. The provider can be re-written this way\n\n```sh\nimport { Injectable } from '@angular/core';\n\ndeclare  let IdentityCordova: any;\n\n@Injectable()\nexport class IdentityProvider {\n\tcaptureSelfie(arg0: any): Promise<any> {\n\t\treturn new Promise(( resolve, reject ) => {\n\t\t\tIdentityCordova.captureSelfie(arg0, ( e ) => resolve(e), ( e ) => reject(e));\n\t\t});\n\n\t}\n\n\tcaptureID(arg0: any): Promise<any> {\n\t\treturn new Promise(( resolve, reject ) => {\n\t\t\tIdentityCordova.captureID(arg0, ( e ) => resolve(e), ( e ) => reject(e));\n\t\t});\n\t}\n\n\t  \n\n\tocrScan(arg0: any): Promise<any> {\n\t\treturn new Promise(( resolve, reject ) => {\n\t\t\tIdentityCordova.ocrScan(arg0, ( e ) => resolve(e), ( e ) => reject(e));\n\t\t});\n\t}\n\n\tloadLicense(arg0: any): Promise<any> {\n\t\treturn new Promise(( resolve, reject ) => {\n\t\t\tIdentityCordova.loadLicense(arg0, ( e ) => resolve(e), ( e ) => reject(e));\n\t\t});\n\n\t}\n\n\tupload(jobInfo: any, partnerParams: any, userIdInfo: any, sidNetInfo: any): Promise<any> {\n\t\treturn new Promise(( resolve, reject ) => {\n\t\t\tIdentityCordova.upload(jobInfo, partnerParams, userIdInfo, sidNetInfo, ( e ) => resolve(e), ( e ) => reject(e));\n\t\t});\n\t}\n\n}\n```\n\n#### Step 2\n\nAdd the following to your page. The code does not have to be the same.\n\n##### HTML\n\n```sh\n\n<button ion-button full (click)=\"captureSelfie()\">Capture Selfie</button>\n<button ion-button full (click)=\"captureIDCard()\">Capture ID </button>\n<button ion-button full (click)=\"captureSelfieAndID()\">Register with ID Card</button>\n<button ion-button full (click)=\"captureOCR()\">Capture OCR</button>\n<button ion-button full (click)=\"matchSelfieandID()\">Match Selfie and ID</button>\n<button ion-button full (click)=\"matchSelfieandOCR()\">Match Selfie and OCR</button>\n```\n\n#### # TypeScript\n```sh\n...\nimport { IdentityProvider } from '../../providers/identity/[provider file name]';\n\n....\n\nconstructor(public identity: IdentityProvider) {\n\nlet that = this; \n\n....\n\ncaptureSelfie() {\n\tlet that = this;\n\tthis.getTag().then(result => {\n\t\tlet tag = \"test_unique_tag_\" + result;\n\t\tthat.identity.captureSelfie(tag).then(result => {\n\t\t\tif (result[\"ID_RESULT\"] === \"success\") {\n\t\t\t\t...\n\t\t\t} else {\n\t\t\t\t...\n\t\t\t}\n\t\t}).catch(err => {\n\t\t\t...\n\t\t})\n\t}).catch(err => {\n\t\t...\n\t})\n}\n\ncaptureIDCard() {\n\tlet that = this;\n\tthis.getTag().then(result => {\n\t\tlet tag = \"test_unique_tag_\" + result;\n\t\tthat.identity.captureID(tag).then(result => {\n\t\t\tif (result[\"ID_RESULT\"] === \"success\") {\n\t\t\t\t...\n\t\t\t} else {\n\t\t\t...\n\t\t\t}\n\t\t}).catch(err => {\n\t\t...\n\t\t})\n\t}).catch(err => {\n\t...\n\t})\n}\n\nasync captureSelfieAndID() {\n\tlet loading = this.loadingController.create({\n\tcssClass: 'my-custom-class',\n\tcontent: 'Please wait...',\n\tduration: 200000\n\n\t});\n\n\tlet that = this;\n\tlet d = new Date();\n\tvar n = d.getTime();\n\tlet tag = \"mic\" + n;\n\tthat.identity.captureSelfie(tag).then(result => {\n\t\tif (result[\"ID_RESULT\"] === \"success\") {\n\t\t\tthat.identity.captureID(tag).then(result => {\n\t\t\t\tif (result[\"ID_RESULT\"] === \"success\") {\n\t\t\t\t\tloading.present();\n\t\t\t\t\tthat.upload(1, tag, true, tag).then(result => {\n\t\t\t\t\t\tthat.storage.set('last_tag', tag);\n\t\t\t\t\t\tloading.dismiss();\n\t\t\t\t\t\t....\n\t\t\t\t\t}).catch(err => {\n\t\t\t\t\tloading.dismiss();\n\t\t\t\t\t\t....\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(result[\"ID_RESULT\"])\n\t\t\t\t\t....\n\t\t\t\t}\n\t\t\t}).catch(err => {\n\t\t\t\t....\n\t\t\t})\n\t\t} else {\n\t\t\tconsole.log(result[\"ID_RESULT\"])\n\t\t\t.....\n\t\t}\n\t}).catch(err => {\n\t\t....\n\t})\n}\n....\n \ncaptureOCR() {\n\tlet that = this;\n\tthis.getTag().then(result => {\n\t\tlet tag = \"test_unique_tag_\" + result;\n\t\tthat.identity.ocrScan(tag).then(result => {\n\t\t\tif (result[\"OCR_RESULT\"] === \"success\") {\n\t\t\t\t...\n\t\t\t} else {\n\t\t\t...\n\t\t\t}\n\t\t}).catch(err => {\n\t\t....\n\t\t})\n\t}).catch(err => {\n\t...\n\t})\n}\n```\n\n<b>Alternative</b> approach incase the above does not work:\n\n#### # TypeScript\n\n```sh\n...\nimport ...\n\ndeclare  let IdentityCordova: any;\n....\nconstructor(public identity: IdentityProvider) {\nlet that = this;\n....\n\ncaptureSelfie() {\n\tlet that = this;\n\tlet tag = \"test_unique_tag_1\";\n\tIdentityCordova.captureSelfie(tag, ( result ) => {\n\t\tif(result && result != \"success\") {\n\t\t\tvar results = JSON.parse(result);\n\t\t\tif (results[\"ID_RESULT\"] === \"success\") {\n\t\t\t\t...\n\t\t\t} else {\n\t\t\t\t...\n\t\t\t}\n\t\t} else {\n\t\t\t...\n\t\t}\n\t}, ( err ) => {\n\t\t...\n\t});\n}\n\ncaptureIDCard() {\n\tlet that = this;\n\tlet tag = \"test_unique_tag_2\";\n\tIdentityCordova.captureID(tag, ( result ) => {\n\t\tif(result && result != \"success\") {\n\t\t\tvar results = JSON.parse(result);\n\t\t\tif (results[\"ID_RESULT\"] === \"success\") {\n\t\t\t\t...\n\t\t\t} else {\n\t\t\t\t...\n\t\t\t}\n\t\t} else {\n\t\t\t...\n\t\t}\n\t}, ( err ) => {\n\t...\n\t})\n} \n\ncaptureSelfieAndID() {\n\tlet loading = this.loadingController.create({\n\tcssClass: 'my-custom-class',\n\tmessage: 'Please wait...',\n\tduration: 200000\n\n\t});\n\n\tlet that = this;\n\tlet d = new Date();\n\tvar n = d.getTime();\n\tlet tag = \"aimc\" + n;\n\tconsole.log(\"AIM\");\n\tIdentityCordova.captureSelfie(tag, ( result ) => {\n\t\tif(result && result != \"success\") {\n\t\t\tvar results = JSON.parse(result);\n\t\t\tif (results[\"ID_RESULT\"] === \"success\") {\n\t\t\t\tIdentityCordova.captureID(tag, ( idResult ) => {\n\t\t\t\t\tif (idResult && idResult != \"success\") {\n\t\t\t\t\t\tvar idResults = JSON.parse(idResult);\n\t\t\t\t\t\tif (idResults[\"ID_RESULT\"] === \"success\") {\n\t\t\t\t\t\t\tIdentityCordova.upload(1, tag, true, tag, ( result ) => {\n\t\t\t\t\t...\n\t\t\t\t\t\t\t}, ( err ) => {\n\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t...\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t...\n\t\t\t\t\t}\n\t\t\t\t}, ( err ) => {\n\t\t\t\t\t...\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\t...\n\t\t\t}\n\t\t} else {\n\t\t\t...\n\t\t}\n\t}, ( err ) => {\n\t\t...\n\t})\n}\n....\n\ncaptureOCR() {\n\tlet that = this;\n\tlet tag = \"test_unique_tag_3\";\n\tIdentityCordova.showScanner(tag, (result) => {\n\t\tif(result && result != \"success\") {\n\t\t\tvar results = JSON.parse(result);\n\t\t\tif (results[\"ID_RESULT\"] === \"success\") {\n\t\t\t\t...\n\t\t\t} else {\n\t\t\t\t...\n\t\t\t}\n\t\t} else {\n\t\t...\n\t\t}\n\t}, (err) => {\n\t...\n\t})\n}\n\nmatchSelfieandID() {\n\tlet that = this;\n\tlet tag = \"test_unique_tag_1\";\n\tIdentityCordova.captureSelfie(tag, ( result ) => {\n\t\tif(result && result != \"success\") {\n\t\t\ttry {\n\t\t\t\tvar results = JSON.parse(result);\n\t\t\t\tif (results[\"ID_RESULT\"] === \"success\") {\n\t\t\t\t\tvar firstImage = results[\"RESULT_DATA\"];\n\t\t\t\t\tIdentityCordova.captureID(tag, ( idResult ) => {\n\t\t\t\t\t\tif(idResult && (idResult != \"success\" || idResult != \"ok\")) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tvar idResults = JSON.parse(idResult);\n\t\t\t\t\t\t\t\tif (idResults[\"ID_RESULT\"] === \"success\") {\n\t\t\t\t\t\t\t\t\tvar secondImage = idResults[\"RESULT_DATA\"];\n\t\t\t\t\t\t\t\t\tIdentityCordova.matchFaces(firstImage, secondImage, ( matchResult ) => {\n\t\t\t\t\t\t\t\t\t\tif(matchResult && (matchResult != \"success\" || matchResult != \"ok\")) {\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tvar matchResults = JSON.parse(matchResult);\n\t\t\t\t\t\t\t\t\t\t\t\tif(matchResults && matchResults[\"resultCode\"]) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar similarity = matchResults[\"resultCode\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}, ( err ) => {\n\t\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t...\n\t\t\t\t\t\t}\n\t\t\t\t\t}, ( err ) => {\n\t\t\t\t\t\t...\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t...\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t...\n\t\t\t}\n\t\t} else {\n\t\t\t...\n\t\t}\n\t}, ( err ) => {\n\t\t...\n\t});\n}\n\n\nmatchSelfieandOCR() {\n\tlet that = this;\n\tlet tag = \"test_unique_tag_1\";\n\tIdentityCordova.captureSelfie(tag, ( result ) => {\n\t\tif(result && result != \"success\") {\n\t\t\ttry {\n\t\t\t\tvar results = JSON.parse(result);\n\t\t\t\tif (results[\"ID_RESULT\"] === \"success\") {\n\t\t\t\t\tvar firstImage = results[\"RESULT_DATA\"];\n\t\t\t\t\tIdentityCordova.showScanner(tag, ( idResult ) => {\n\t\t\t\t\t\tif(idResult && (idResult != \"success\" || idResult != \"ok\")) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tvar idResults = JSON.parse(idResult);\n\t\t\t\t\t\t\t\tif (idResults[\"ID_RESULT\"] === \"success\") { \n\t\t\t\t\t\t\t\t\tif(idResults[\"PORTRAIT_RESULT_DATA\"]) {\n\t\t\t\t\t\t\t\t\t\tvar secondImage = idResults[\"PORTRAIT_RESULT_DATA\"];\n\t\t\t\t\t\t\t\t\t\tIdentityCordova.matchFaces(firstImage, secondImage, ( matchResult ) => {\n\t\t\t\t\t\t\t\t\t\t\tif(matchResult && (matchResult != \"success\" || matchResult != \"ok\")) {\n\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar matchResults = JSON.parse(matchResult);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(matchResults && matchResults[\"resultCode\"]) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar similarity = matchResults[\"resultCode\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tthat.ngZone.run(() => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}, ( err ) => {\n\t\t\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t} else if(results[\"DOCUMENT_RESULT_DATA\"]){\n\t\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t...\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t...\n\t\t\t\t\t\t}\n\t\t\t\t\t}, ( err ) => {\n\t\t\t\t\t\t...\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t...\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t...\n\t\t\t}\n\t\t} else {\n\t\t\t...\n\t\t}\n\t}, ( err ) => {\n\t\t...\n\t});\n}\n```\n\n  \n\n### Install license\n\n1. Get a license from AIM Group. We will need your App package ID to generate the license for you.\n\n2. Load the license key on your App initialization process. This would usually be on app.component.ts file.\n\n\n```sh\n\nthis.platform.ready().then(() => {\n\tthis.loadLicense();\n\t...\n\tthis.statusBar.styleDefault();\n\tthis.splashScreen.hide();\n});\n\n...\n\n\nasync loadLicense() {\n\tlet that = this;\n\tthat.identity.loadLicense(btoa(\"XXXX-XXXXX-XXXX-XXXX-XXXXX-XXXXXX\")).then(result => {\n\t\tconsole.log(\"license loaded\");\n\t}).catch(err => {\n\t\tconsole.log(\"error loading license: \" + err);\n\t});\n} \n```\n\n<b>Note: </b>The app has to be online for the license to be activated\n\n### Run Android\n\n#### Step 1\n\n```sh\n$ npm i\n```\n\n### Step 2\n\n```sh\n$ ionic cordova platform add android\n```\n\n### Step 3\n\nConfigure your platforms/android/local.properties to point to your ndk and sdk locations\n\n```groovy\nndk.dir=$ANDROID_NDK_HOME\nsdk.dir=$ANDROID_SDK_HOME\n```\n\n### Step 4\n\nReplace the contents of the file platforms/android/project.properties with the below\n\n```groovy\ntarget=android-28\nandroid.library.reference.1=CordovaLib\nandroid.library.reference.2=app\ncordova.system.library.1=com.android.support:support-annotations:27.+\ncordova.gradle.include.1=cordova-android-play-services-gradle-release/starter-cordova-android-play-services-gradle-release.gradle\ncordova.system.library.3=com.google.android.gms:play-services-vision:18.0.0\ncordova.system.library.4=com.android.support:appcompat-v7:28.0.0\ncordova.system.library.5=com.android.support:support-v4:28.0.0\ncordova.system.library.6=com.android.support.constraint:constraint-layout:1.1.3\ncordova.system.library.7=com.android.support:exifinterface:28.0.0\ncordova.system.library.8=com.google.code.gson:gson:2.8.4\ncordova.gradle.include.2=app/build-extras.gradle\n```\n\n### Step 5\n\nAdd gradle dependancies to platforms/android/app/build.gradle under the app dependancies\n\n```groovy\nimplementation \"com.android.support:support-annotations:27.+\"\nimplementation \"com.google.android.gms:play-services-vision:18.0.0\"\nimplementation \"com.android.support:appcompat-v7:28.0.0\"\nimplementation \"com.android.support:support-v4:28.0.0\"\nimplementation \"com.android.support.constraint:constraint-layout:1.1.3\"\nimplementation \"com.android.support:exifinterface:28.0.0\"\nimplementation \"com.google.code.gson:gson:2.8.4\"\n```\n\n### Build and Run\n\nConnect your android device and run\n\n```sh\n$ ionic cordova run android\n```\n\n### Troubleshoot Android\n\nYou may need to make the following change to SystemCookieManager under /platforms/android/CordovaLib/src/org/apache/cordova/engine for lower versions support.\n\n```groovy\n- cookieManager.setAcceptThirdPartyCookies(webView, true);\n+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n\t+ cookieManager.setAcceptThirdPartyCookies(webView, true);\n+ }\n```\n\nMethod setAcceptThirdPartyCookies was added in version 6, lower version may cause the build to fail.\n\n### Run IOS\n\n#### Step 1\n```sh\n$ ionic cordova platform add ios\n```\n\n#### Step 2\n\n- Request the IOS Libraries from AIM Group\n- Place this .framework file at the root of your project\n- In XCode select your project and add the .framework under frameworks, libraries and embedded content by clicking add files\n\n#### Step 2\nRun in XCode"},"npm":{"downloads":[{"from":"2022-07-14T00:00:00.000Z","to":"2022-07-15T00:00:00.000Z","count":0},{"from":"2022-07-08T00:00:00.000Z","to":"2022-07-15T00:00:00.000Z","count":1},{"from":"2022-06-15T00:00:00.000Z","to":"2022-07-15T00:00:00.000Z","count":48},{"from":"2022-04-16T00:00:00.000Z","to":"2022-07-15T00:00:00.000Z","count":277},{"from":"2022-01-16T00:00:00.000Z","to":"2022-07-15T00:00:00.000Z","count":578},{"from":"2021-07-15T00:00:00.000Z","to":"2022-07-15T00:00:00.000Z","count":1055}],"starsCount":0},"source":{"files":{"readmeSize":17196,"testsSize":0}}},"evaluation":{"quality":{"carefulness":0.355,"tests":0,"health":1,"branding":0},"popularity":{"communityInterest":0,"downloadsCount":92.33333333333333,"downloadsAcceleration":-0.24242770167427696,"dependentsCount":0},"maintenance":{"releasesFrequency":0.6398972602739726,"commitsFrequency":0,"openIssues":0,"issuesDistribution":0}},"score":{"final":0.24393580659017955,"detail":{"quality":0.41332444876593966,"popularity":0.009420788635086375,"maintenance":0.33326055982319264}}}