From 5bff35f040a346c1b27dd6a91aabedb3102308c1 Mon Sep 17 00:00:00 2001 From: Jure Cular Date: Mon, 9 Oct 2017 15:30:16 +0200 Subject: [PATCH 1/6] Removed blinkid-ios as submodule --- .gitmodules | 3 --- BlinkID/src/ios/blinkid-ios | 1 - 2 files changed, 4 deletions(-) delete mode 160000 BlinkID/src/ios/blinkid-ios diff --git a/.gitmodules b/.gitmodules index 8fc9c07..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "BlinkID/src/ios/blinkid-ios"] - path = BlinkID/src/ios/blinkid-ios - url = git@github.com:BlinkID/blinkid-ios.git diff --git a/BlinkID/src/ios/blinkid-ios b/BlinkID/src/ios/blinkid-ios deleted file mode 160000 index e04c873..0000000 --- a/BlinkID/src/ios/blinkid-ios +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e04c873c80d8692f04f1452badb407f4e24e18f0 From f8cf8291df863a735fdebbccb652cf1b8b87a0fe Mon Sep 17 00:00:00 2001 From: Jure Cular Date: Mon, 9 Oct 2017 18:19:53 +0200 Subject: [PATCH 2/6] Added script to fetch microblink framework and bundle --- .gitignore | 3 +++ BlinkID/initIOSFramework.sh | 29 +++++++++++++++++++++++++++++ initCordovaDemoApp.sh | 7 +++++++ initIonicDemoApp.sh | 7 +++++++ 4 files changed, 46 insertions(+) create mode 100755 BlinkID/initIOSFramework.sh diff --git a/.gitignore b/.gitignore index 4a75f67..2dacf65 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # Mac .DS_Store +# blinkid-ios containing framework and bundle +BlinkID/src/ios/blinkid-ios + # demo app BlinkIdDemo diff --git a/BlinkID/initIOSFramework.sh b/BlinkID/initIOSFramework.sh new file mode 100755 index 0000000..27996ea --- /dev/null +++ b/BlinkID/initIOSFramework.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# enter into ios project folder +cd src/ios/ + +# check if Microblink framework and bundle already exist +if [ ! -d 'blinkid-ios' ] ; then + + VERSION='2.12.0' + + echo "Cloning repo with Microblink framework v${VERSION}" + # clone blinkID repository + # git clone "git@github.com:BlinkID/blinkid-ios.git" + cd blinkid-ios + git checkout "v${VERSION}" + + mv Microblink.framework ../Microblink.framework + mv Microblink.bundle ../Microblink.bundle + + rm -rfv * + + mv ../Microblink.framework Microblink.framework + mv ../Microblink.bundle Microblink.bundle + + cd .. + +fi + +cd ../../ \ No newline at end of file diff --git a/initCordovaDemoApp.sh b/initCordovaDemoApp.sh index 32ae643..e7d59ba 100755 --- a/initCordovaDemoApp.sh +++ b/initCordovaDemoApp.sh @@ -4,6 +4,13 @@ HERE="$(dirname "$(test -L "$0" && readlink "$0" || echo "$0")")" pushd $HERE >> /dev/null +# enter BlinkID framework folder +cd BlinkID +# init blinkid-ios using cococapods +./initIOSFramework.sh $1 +# go back to root folder +cd .. + # remove any existing code rm -rf BlinkIdDemo diff --git a/initIonicDemoApp.sh b/initIonicDemoApp.sh index 626dd99..21e0d51 100755 --- a/initIonicDemoApp.sh +++ b/initIonicDemoApp.sh @@ -1,5 +1,12 @@ #!/bin/bash +# enter BlinkID framework folder +cd BlinkID +# init blinkid-ios using cococapods +./initIOSFramework.sh +# go back to root folder +cd .. + # remove any existing code rm -rf BlinkIdDemo From 5c9c350b102c35047fe6b2526fd06642d7fd7453 Mon Sep 17 00:00:00 2001 From: Jure Cular Date: Mon, 9 Oct 2017 18:20:39 +0200 Subject: [PATCH 3/6] Removed scan1DCodes flag from ios cordova wrapper --- BlinkID/src/ios/sources/CDVblinkIdScanner.m | 6 ------ 1 file changed, 6 deletions(-) diff --git a/BlinkID/src/ios/sources/CDVblinkIdScanner.m b/BlinkID/src/ios/sources/CDVblinkIdScanner.m index 8f87035..ce47e8f 100644 --- a/BlinkID/src/ios/sources/CDVblinkIdScanner.m +++ b/BlinkID/src/ios/sources/CDVblinkIdScanner.m @@ -90,12 +90,6 @@ - (PPUsdlRecognizerSettings *)usdlRecognizerSettings { */ usdlRecognizerSettings.allowNullQuietZone = YES; - /** - * Set this to YES if you want to scan 1D barcodes if they are present on the DL. - * If NO, just PDF417 barcode will be scanned. - */ - usdlRecognizerSettings.scan1DCodes = NO; - return usdlRecognizerSettings; } From 4848ba8801852a8a0198c75df7e287bf914d9458 Mon Sep 17 00:00:00 2001 From: Jure Cular Date: Tue, 17 Oct 2017 10:16:30 +0200 Subject: [PATCH 4/6] Updated cordova and cordova-ios version requirements --- BlinkID/package.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BlinkID/package.json b/BlinkID/package.json index 68c7b51..3d63dcf 100644 --- a/BlinkID/package.json +++ b/BlinkID/package.json @@ -22,11 +22,15 @@ "engines": [ { "name": "cordova", - "version": ">=3.0.0" + "version": ">=7.0.0" }, { "name": "cordova-android", "version": ">=4.0.0" + }, + { + "name": "cordova-ios", + "version": ">=4.4.0" } ], "author": "Microblink", From 8ac2907e1c72218ba5e846eb04923db54cb8d406 Mon Sep 17 00:00:00 2001 From: Jure Cular Date: Tue, 17 Oct 2017 10:17:11 +0200 Subject: [PATCH 5/6] Removed obsolete script for embeded framework --- BlinkID/addEmbedded.js | 138 ----------------------------------------- BlinkID/plugin.xml | 2 - 2 files changed, 140 deletions(-) delete mode 100644 BlinkID/addEmbedded.js diff --git a/BlinkID/addEmbedded.js b/BlinkID/addEmbedded.js deleted file mode 100644 index 717c5b9..0000000 --- a/BlinkID/addEmbedded.js +++ /dev/null @@ -1,138 +0,0 @@ -'use strict'; - -const xcode = require('xcode'), - fs = require('fs'), - path = require('path'); - -module.exports = function(context) { - if(context && context.opts && context.opts.cordova){ - if(context.opts.cordova.platforms && context.opts.cordova.platforms.indexOf("ios")){ - return; // plugin only meant to work for ios platform. - } - } - - function fromDir(startPath,filter, rec, multiple){ - if (!fs.existsSync(startPath)){ - console.log("no dir ", startPath); - return; - } - - const files=fs.readdirSync(startPath); - var resultFiles = [] - for(var i=0;i=0) { - if (multiple) { - resultFiles.push(filename); - } else { - return filename; - } - } - } - if(multiple) { - return resultFiles; - } - } - - function getFileIdAndRemoveFromFrameworks(myProj, fileBasename) { - var fileId = ''; - const pbxFrameworksBuildPhaseObjFiles = myProj.pbxFrameworksBuildPhaseObj(myProj.getFirstTarget().uuid).files; - for(var i=0; i - - From 9a7f796e395877a61e2cb86d4a4287c6dd9d50ce Mon Sep 17 00:00:00 2001 From: Jure Cular Date: Tue, 17 Oct 2017 10:38:33 +0200 Subject: [PATCH 6/6] Updated project initialization scripts --- initCordovaDemoApp.sh | 12 +++++++----- initIonicDemoApp.sh | 29 ++++++++++++++++++----------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/initCordovaDemoApp.sh b/initCordovaDemoApp.sh index e7d59ba..a417a0f 100755 --- a/initCordovaDemoApp.sh +++ b/initCordovaDemoApp.sh @@ -1,5 +1,7 @@ #!/bin/bash +APP_NAME="BlinkIdDemo" + # position to a relative path HERE="$(dirname "$(test -L "$0" && readlink "$0" || echo "$0")")" pushd $HERE >> /dev/null @@ -12,10 +14,10 @@ cd BlinkID cd .. # remove any existing code -rm -rf BlinkIdDemo +rm -rf $APP_NAME # create a sample application -cordova create BlinkIdDemo com.microblink.blinkid BlinkIdDemo +cordova create $APP_NAME com.microblink.blinkid $APP_NAME # enter into demo project folder cd BlinkIdDemo @@ -31,8 +33,8 @@ cordova platform add ios cp -f -r ../www . # build app -cordova build +cordova prepare # how to run -echo "To run iOS demo application open Xcode project BlinkIdDemo.xcodeproj" -echo "To run Android demo application, position to BlinkIdDemo folder and type: cordova run android" +echo "To run iOS demo application open Xcode project $APP_NAME.xcodeproj" +echo "To run Android demo application, position to $APP_NAME folder and type: cordova run android" diff --git a/initIonicDemoApp.sh b/initIonicDemoApp.sh index 21e0d51..e8b255f 100755 --- a/initIonicDemoApp.sh +++ b/initIonicDemoApp.sh @@ -1,5 +1,8 @@ #!/bin/bash +APP_NAME="BlinkIdDemo" +APP_ID="com.microblink.blinkid" + # enter BlinkID framework folder cd BlinkID # init blinkid-ios using cococapods @@ -8,28 +11,32 @@ cd BlinkID cd .. # remove any existing code -rm -rf BlinkIdDemo +rm -rf $APP_NAME # create a sample application -ionic start --id=com.microblink.blinkid BlinkIdDemo ./www --v2 +ionic start $APP_NAME blank --no-link # enter into demo project folder -cd BlinkIdDemo +cd $APP_NAME + +# change the name and id of the application +sed -i "" "s/io.ionic.starter/$APP_ID/" config.xml +sed -i "" "s/MyApp/$APP_NAME/" config.xml # add the BlinkID plugin -ionic plugin add ../BlinkID +ionic cordova plugin add ../BlinkID # add ios and android support to the project -ionic platform add android -ionic platform add ios +ionic cordova platform add android +ionic cordova platform add ios # copy content of the www folder -cp -f -r ../www/* ./src/ +cp -f -r ../www/index.html ./src/ +cp -f -r ../www/js ./www/ # build app -ionic build android -ionic build ios +ionic build # how to run -echo "To run iOS demo application open Xcode project BlinkIdDemo.xcodeproj" -echo "To run Android demo application, position to BlinkIdDemo folder and type: ionic run android" \ No newline at end of file +echo "To run iOS demo application open Xcode project $APP_NAME.xcodeproj" +echo "To run Android demo application, position to $APP_NAME folder and type: ionic cordova run android" \ No newline at end of file