Skip to content

Commit

Permalink
Merged in IOS-126-ios-no-submodule (pull request #10)
Browse files Browse the repository at this point in the history
IOS-126 ios no submodule
  • Loading branch information
Jure Čular committed Oct 18, 2017
2 parents 91d98af + 9a7f796 commit b69fe9c
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 167 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Mac
.DS_Store

# blinkid-ios containing framework and bundle
BlinkID/src/ios/blinkid-ios

# demo app
BlinkIdDemo

Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "BlinkID/src/ios/blinkid-ios"]
path = BlinkID/src/ios/blinkid-ios
url = [email protected]:BlinkID/blinkid-ios.git
138 changes: 0 additions & 138 deletions BlinkID/addEmbedded.js

This file was deleted.

29 changes: 29 additions & 0 deletions BlinkID/initIOSFramework.sh
Original file line number Diff line number Diff line change
@@ -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 "[email protected]: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 ../../
6 changes: 5 additions & 1 deletion BlinkID/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions BlinkID/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@
<hook type="after_prepare" src="scripts/fix-largeheap.js" />
</platform>

<hook type="after_platform_add" src="addEmbedded.js" />

<platform name="ios">
<source-file src="src/ios/sources/CDVblinkIdScanner.m" />
<header-file src="src/ios/sources/CDVblinkIdScanner.h" />
Expand Down
1 change: 0 additions & 1 deletion BlinkID/src/ios/blinkid-ios
Submodule blinkid-ios deleted from e04c87
6 changes: 0 additions & 6 deletions BlinkID/src/ios/sources/CDVblinkIdScanner.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
19 changes: 14 additions & 5 deletions initCordovaDemoApp.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
#!/bin/bash

APP_NAME="BlinkIdDemo"

# position to a relative path
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
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
Expand All @@ -24,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"
36 changes: 25 additions & 11 deletions initIonicDemoApp.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@
#!/bin/bash

APP_NAME="BlinkIdDemo"
APP_ID="com.microblink.blinkid"

# 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
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"
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"

0 comments on commit b69fe9c

Please sign in to comment.