Skip to content

Commit

Permalink
updated to anyline 1.9
Browse files Browse the repository at this point in the history
implemented dokucment Snapper on Android
  • Loading branch information
Jonas committed Mar 1, 2017
1 parent 734a59b commit 76c2793
Show file tree
Hide file tree
Showing 15 changed files with 518 additions and 155 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ repositories {
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'io.anyline:anylinesdk:3.8.1@aar'
compile 'io.anyline:anylinesdk:3.9.0@aar'
compile 'com.google.android.gms:play-services-vision:10.0.1'
compile 'com.android.support:design:25.1.0'
compile "com.facebook.react:react-native:+" // From node_modules
Expand Down
1 change: 1 addition & 0 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
<activity android:name="com.anyline.reactnative.MrzActivity"/>
<activity android:name="com.anyline.reactnative.BarcodeActivity"/>
<activity android:name="com.anyline.reactnative.AnylineOcrActivity"/>
<activity android:name="com.anyline.reactnative.DocumentActivity"/>
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
public static final int ANYLINE_OCR = 5;
public static final int BARCODE = 6;
public static final int ANYLINE_MRZ = 7;
public static final int ANYLINE_DOCUMENT = 8;


private JSONObject configObject;
Expand Down Expand Up @@ -84,7 +85,7 @@ public void setupScanViewWithConfigJson(String config, String scanMode, Callback
scan(MrzActivity.class, config, scanMode, ANYLINE_MRZ);
break;
case "DOCUMENT":
onErrorCallback.invoke("Not implemented yet");
scan(DocumentActivity.class, config, scanMode, ANYLINE_DOCUMENT);
break;
default:
onErrorCallback.invoke("Wrong ScanMode");
Expand Down
390 changes: 390 additions & 0 deletions android/src/main/java/com/anyline/reactnative/DocumentActivity.java

Large diffs are not rendered by default.

17 changes: 11 additions & 6 deletions example/Anyline/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
Expand All @@ -14,13 +13,10 @@ build/
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IntelliJ
#
Expand All @@ -34,12 +30,21 @@ local.properties
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
android/app/libs
*.keystore

ios/Pods
ios/Podfile.lock
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
66 changes: 0 additions & 66 deletions example/Anyline/android/app/BUCK

This file was deleted.

3 changes: 3 additions & 0 deletions example/Anyline/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ android {
}

dependencies {
compile project(':react-native-vector-icons')
compile project(':react-native-permissions')
compile project(':react-native-android-permissions')
compile project(':anyline-ocr-react-native-module')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:25.0.1"
Expand Down
40 changes: 20 additions & 20 deletions example/Anyline/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.anyline"
android:versionCode="1"
android:versionName="1.0">
package="com.anyline"
android:versionCode="1"
android:versionName="1.0">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.VIBRATE"/>

<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="22" />
android:minSdkVersion="18"
android:targetSdkVersion="22" />

<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity android:name="com.anyline.reactnative.EnergyActivity"/>
<activity android:name="com.anyline.reactnative.MrzActivity"/>
<activity android:name="com.anyline.reactnative.BarcodeActivity"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import android.util.Log;

import com.facebook.react.ReactApplication;
import com.oblador.vectoricons.VectorIconsPackage;
import com.joshblour.reactnativepermissions.ReactNativePermissionsPackage;
import com.burnweb.rnpermissions.RNPermissionsPackage;
import com.anyline.reactnative.AnylinePackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
Expand All @@ -18,14 +21,17 @@ public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected boolean getUseDeveloperSupport() {
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}

@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new VectorIconsPackage(),
new ReactNativePermissionsPackage(),
new RNPermissionsPackage(),
new AnylinePackage()
);
}
Expand Down
6 changes: 6 additions & 0 deletions example/Anyline/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
rootProject.name = 'Anyline'
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-permissions'
project(':react-native-permissions').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-permissions/android')
include ':react-native-android-permissions'
project(':react-native-android-permissions').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-permissions/android')
include ':anyline-ocr-react-native-module'
project(':anyline-ocr-react-native-module').projectDir = new File(rootProject.projectDir, '../node_modules/anyline-ocr-react-native-module/android')

Expand Down
2 changes: 1 addition & 1 deletion example/Anyline/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
license: 'eyAiYW5kcm9pZElkZW50aWZpZXIiOiBbICJlb24ucmVhY3QucHJvdG90eXBlIiBdLCAiZGVidWdSZXBvcnRpbmciOiAib3B0LW91dCIsICJpb3NJZGVudGlmaWVyIjogWyAiZW9uLnJlYWN0LnByb3RvdHlwZSIgXSwgImxpY2Vuc2VLZXlWZXJzaW9uIjogMiwgIm1ham9yVmVyc2lvbiI6ICIzIiwgInBpbmdSZXBvcnRpbmciOiB0cnVlLCAicGxhdGZvcm0iOiBbICJpT1MiLCAiQW5kcm9pZCIgXSwgInNjb3BlIjogWyAiRU5FUkdZIiBdLCAic2hvd1dhdGVybWFyayI6IGZhbHNlLCAidG9sZXJhbmNlRGF5cyI6IDkwLCAidmFsaWQiOiAiMjAxNy0xMi0wNyIgfQpoVThydDFaWE9iTk9aVEVQaklMN2hYUC9ZanorVHFrYVU3L1JNek1CbG1ScUtZcXNFekpjZ0lLWCswalUyNGJKCnp6elErMXhDa0dZaWREZ1ZqTFY3SnY3ZjZUU1NSSWdCSXozb2VwemEybExvbFNZQ1JQZXNrNi9tM0xiRUlBSTYKV2xqc1pEbHFMSVBiQVVHcWJxVjlxZ0o4a1lrdHlYRHBlalFoelJHYk5mancxS05xNjgybitTMU01MWI2MS8rRApvMH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Q\nRjNSc1FxRC9UU244Q0E9PQo=',
options: {
captureResolution: '720p',
cutout: {
Expand Down
56 changes: 33 additions & 23 deletions example/Anyline/ios/Anyline.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,11 @@
TargetAttributes = {
00E356ED1AD99517003FC87E = {
CreatedOnToolsVersion = 6.2;
DevelopmentTeam = PJL7DA2X5F;
DevelopmentTeam = 35RHL53WRE;
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = PJL7DA2X5F;
DevelopmentTeam = 35RHL53WRE;
};
};
};
Expand Down Expand Up @@ -749,7 +749,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
D2F1758ED6F41FAEDD8C23EE /* [CP] Embed Pods Frameworks */ = {
Expand Down Expand Up @@ -814,14 +814,15 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = PJL7DA2X5F;
DEVELOPMENT_TEAM = 35RHL53WRE;
ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native/React/**";
INFOPLIST_FILE = AnylineTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -837,10 +838,11 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
DEVELOPMENT_TEAM = PJL7DA2X5F;
DEVELOPMENT_TEAM = 35RHL53WRE;
ENABLE_BITCODE = NO;
HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native/React/**";
INFOPLIST_FILE = AnylineTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -858,16 +860,24 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = PJL7DA2X5F;
DEVELOPMENT_TEAM = 35RHL53WRE;
ENABLE_BITCODE = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"",
"\"${PODS_ROOT}/Headers/Public/Anyline\"",
"\"${PODS_ROOT}/Headers/Public/AnylineReact\"",
"\"${PODS_ROOT}/Headers/Public/React\"",
"$(SRCROOT)/../node_modules/react-native/React/**",
);
INFOPLIST_FILE = Anyline/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = eon.react.prototype;
PRODUCT_BUNDLE_IDENTIFIER = com.anyline;
PRODUCT_NAME = Anyline;
VERSIONING_SYSTEM = "apple-generic";
};
Expand All @@ -879,16 +889,24 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = PJL7DA2X5F;
DEVELOPMENT_TEAM = 35RHL53WRE;
ENABLE_BITCODE = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"",
"\"${PODS_ROOT}/Headers/Public/Anyline\"",
"\"${PODS_ROOT}/Headers/Public/AnylineReact\"",
"\"${PODS_ROOT}/Headers/Public/React\"",
"$(SRCROOT)/../node_modules/react-native/React/**",
);
INFOPLIST_FILE = Anyline/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = eon.react.prototype;
PRODUCT_BUNDLE_IDENTIFIER = com.anyline;
PRODUCT_NAME = Anyline;
VERSIONING_SYSTEM = "apple-generic";
};
Expand Down Expand Up @@ -928,12 +946,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native/React/**",
"$(SRCROOT)/../node_modules/react-native/ReactCommon/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native/React/**";
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -968,12 +982,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native/React/**",
"$(SRCROOT)/../node_modules/react-native/ReactCommon/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native/React/**";
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand Down
Loading

0 comments on commit 76c2793

Please sign in to comment.