diff --git a/example/RNExampleApp/android/build.gradle b/example/RNExampleApp/android/build.gradle index 03823e4b..1775deaa 100644 --- a/example/RNExampleApp/android/build.gradle +++ b/example/RNExampleApp/android/build.gradle @@ -25,7 +25,7 @@ allprojects { url "$rootDir/../node_modules/react-native/android" } maven { - url 'https://anylinesdk.blob.core.windows.net/maven/' + url 'https://anylinesdk.blob.core.windows.net/testing/' } maven { url 'https://maven.google.com/' diff --git a/plugin/android/build.gradle b/plugin/android/build.gradle index 9d26c1be..e7887e80 100755 --- a/plugin/android/build.gradle +++ b/plugin/android/build.gradle @@ -50,14 +50,14 @@ repositories { dirs 'libs' } maven { - url 'https://anylinesdk.blob.core.windows.net/maven/' + url 'https://anylinesdk.blob.core.windows.net/testing/' } } dependencies { compile fileTree(dir: "libs", include: ["*.jar"]) compile 'com.android.support:appcompat-v7:26.1.0' - compile 'io.anyline:anylinesdk:3.23.0@aar' + compile 'io.anyline:anylinesdk:3.24.0-RC4@aar' compile 'com.google.android.gms:play-services-vision:12.0.1' compile 'com.android.support:design:26.1.0' compile "com.facebook.react:react-native:+" // From node_modules diff --git a/plugin/android/src/main/java/com/anyline/reactnative/DocumentActivity.java b/plugin/android/src/main/java/com/anyline/reactnative/DocumentActivity.java index 637b7347..e9c2297d 100755 --- a/plugin/android/src/main/java/com/anyline/reactnative/DocumentActivity.java +++ b/plugin/android/src/main/java/com/anyline/reactnative/DocumentActivity.java @@ -52,6 +52,7 @@ public class DocumentActivity extends AnylineBaseActivity implements CameraOpenL private TextView errorMessage; private long lastErrorRecieved = 0; private int quality = 100; + private boolean postProcessing = false; private Double maxDocumentOutputResolutionWidth = null; private Double maxDocumentOutputResolutionHeight = null; @@ -121,6 +122,7 @@ protected void onCreate(Bundle savedInstanceState) { this.maxDocumentOutputResolutionHeight = documentConfig.getJSONObject("maxOutputResolution").getDouble("height"); this.ratios = getArrayListFromJsonArray(documentConfig.getJSONObject("ratio").getJSONArray("ratios")); this.ratioDeviation = documentConfig.getJSONObject("ratio").getDouble("deviation"); + this.postProcessing = documentConfig.getBoolean("postProcessing"); } catch (JSONException e) { Log.e(TAG, e.getMessage()); } @@ -147,6 +149,9 @@ protected void onCreate(Bundle savedInstanceState) { documentScanView.setMaxDocumentOutputResolution(maxDocumentOutputResolutionWidth, maxDocumentOutputResolutionHeight); } + // Set PostProcessing + documentScanView.setPostProcessingEnabled(this.postProcessing); + // initialize Anyline with the license key and a Listener that is called if a result is found documentScanView.initAnyline(licenseKey, new DocumentResultListener() { @Override diff --git a/plugin/index.js b/plugin/index.js index 3ac6cf08..0272fe14 100644 --- a/plugin/index.js +++ b/plugin/index.js @@ -4,7 +4,11 @@ const Buffer = require('buffer/').Buffer; export default NativeModules.AnylineSDKPlugin; - +/** + * Decrypts the License and returns the date till it's valid + * + * @param License + */ export const getLicenseExpiryDate = (License) => { const licenseString = Buffer.from(License, 'base64').toString('ascii'); const licenseJsonString = licenseString.substr(0, licenseString.lastIndexOf('}')+1); diff --git a/plugin/ios/AnylineDocumentScanViewController.h b/plugin/ios/AnylineDocumentScanViewController.h index 0fcaa021..2253f0a7 100644 --- a/plugin/ios/AnylineDocumentScanViewController.h +++ b/plugin/ios/AnylineDocumentScanViewController.h @@ -37,4 +37,12 @@ @property (nonatomic, strong) NSArray *ratios; @property (nonatomic, assign) CGFloat ratioDeviation; +/** + * Document PostProcessing + * @warning Parameter can only be changed when the scanning is not running. + * + * @since 3.24 + */ +@property (nonatomic, strong) Boolean postProcessing; + @end diff --git a/plugin/ios/AnylineDocumentScanViewController.m b/plugin/ios/AnylineDocumentScanViewController.m index 48378c7d..89ef5e75 100644 --- a/plugin/ios/AnylineDocumentScanViewController.m +++ b/plugin/ios/AnylineDocumentScanViewController.m @@ -30,6 +30,9 @@ - (void)viewDidLoad { [docModuleView setDocumentRatios:self.ratios]; docModuleView.maxDocumentRatioDeviation = [NSNumber numberWithDouble:self.ratioDeviation]; + // Set PostProcessing of the + [docModuleView setPostProcessingEnabled:self.postProcessing]; + // Set max Output Resolution if(!CGSizeEqualToSize(CGSizeZero, self.maxOutputResolution)){ docModuleView.maxOutputResolution = self.maxOutputResolution; diff --git a/plugin/ios/AnylineSDKPlugin.m b/plugin/ios/AnylineSDKPlugin.m index 31c3f248..2eb41bfa 100644 --- a/plugin/ios/AnylineSDKPlugin.m +++ b/plugin/ios/AnylineSDKPlugin.m @@ -134,6 +134,13 @@ - (AnylineBaseScanViewController *)ViewControllerFromScanMode:(NSString *)scanMo docVC.quality = 100; } + // Check for Document PostProcessing and set it + if([docConfig valueForKey:@"postProcessing"]){ + docVC.postProcessing = [[docConfig valueForKey:@"postProcessing"] boolValue]; + } else { + docVC.postProcessing = false; + } + // Check for Document Max Output Config and set it if([docConfig valueForKey:@"maxOutputResoultion"]){ NSDictionary *maxOutputResoultionConfig = [docConfig valueForKey:@"maxOutputResoultion"];