From a2265f9b224fe03623b1fdb4dc480bbb4698a477 Mon Sep 17 00:00:00 2001 From: vimalvenugopalananyline <147407358+vimalvenugopalananyline@users.noreply.github.com> Date: Thu, 1 Aug 2024 15:46:08 +0530 Subject: [PATCH] Release 53.0.0 (#177) * Release 53.0.0 --- example/RNExampleApp/android/app/build.gradle | 2 +- example/RNExampleApp/config/OdometerConfig.js | 4 +- .../config/SerialScanningConfig.js | 4 +- example/RNExampleApp/config/TINDOTConfig.js | 1 - .../RNExampleApp/config/UniversalIdConfig.js | 4 +- .../RNExampleApp.xcodeproj/project.pbxproj | 94 ++++++++----------- example/RNExampleApp/package.json | 2 +- plugin/android/build.gradle | 2 +- .../com/anyline/reactnative/ScanActivity.java | 14 ++- plugin/ios/ALNFCScanViewController.m | 16 ++-- plugin/ios/ALPluginHelper.h | 2 +- plugin/ios/ALPluginHelper.m | 7 +- plugin/ios/ALPluginScanViewController.m | 61 +++++++----- plugin/ios/AnylineReact.podspec | 2 +- plugin/ios/AnylineSDKPlugin.m | 49 +++++----- plugin/package.json | 16 ++-- 16 files changed, 144 insertions(+), 136 deletions(-) diff --git a/example/RNExampleApp/android/app/build.gradle b/example/RNExampleApp/android/app/build.gradle index 703f5fc3..2bb3b534 100644 --- a/example/RNExampleApp/android/app/build.gradle +++ b/example/RNExampleApp/android/app/build.gradle @@ -87,7 +87,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 5 - versionName "52.0.1" + versionName "53.0.0" multiDexEnabled true buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString()) diff --git a/example/RNExampleApp/config/OdometerConfig.js b/example/RNExampleApp/config/OdometerConfig.js index 3bfd2b9f..6008b7f2 100644 --- a/example/RNExampleApp/config/OdometerConfig.js +++ b/example/RNExampleApp/config/OdometerConfig.js @@ -38,10 +38,10 @@ export default { } }, "scanFeedbackConfig" : { - "style" : "CONTOUR_RECT", + "style" : "contour_rect", "strokeColor" : "0099FF", "fillColor" : "220099FF", - "blinkOnResult": true, + "blinkAnimationOnResult": true, "beepOnResult": true, "vibrateOnResult": true } diff --git a/example/RNExampleApp/config/SerialScanningConfig.js b/example/RNExampleApp/config/SerialScanningConfig.js index 2e0704e8..e426a69f 100644 --- a/example/RNExampleApp/config/SerialScanningConfig.js +++ b/example/RNExampleApp/config/SerialScanningConfig.js @@ -113,8 +113,8 @@ export default { "feedbackStrokeColor": "0099FF" }, "scanFeedbackConfig": { - "style": "CONTOUR_RECT", - "visualFeedbackRedrawTimeout": 100, + "style": "contour_rect", + "redrawTimeout": 100, "strokeColor": "0099FF", "fillColor": "220099FF", "beepOnResult": true, diff --git a/example/RNExampleApp/config/TINDOTConfig.js b/example/RNExampleApp/config/TINDOTConfig.js index c29e7c7a..991563f4 100644 --- a/example/RNExampleApp/config/TINDOTConfig.js +++ b/example/RNExampleApp/config/TINDOTConfig.js @@ -1,5 +1,4 @@ export default { - license: '', //INSERT YOUR LICENSE KEY HERE "options": { "doneButtonConfig": { "offset.y": -88 diff --git a/example/RNExampleApp/config/UniversalIdConfig.js b/example/RNExampleApp/config/UniversalIdConfig.js index 6444178e..c5ed2757 100755 --- a/example/RNExampleApp/config/UniversalIdConfig.js +++ b/example/RNExampleApp/config/UniversalIdConfig.js @@ -138,8 +138,8 @@ export default { "feedbackStrokeColor": "0099FF" }, "scanFeedbackConfig": { - "style": "CONTOUR_RECT", - "visualFeedbackRedrawTimeout": 100, + "style": "contour_rect", + "redrawTimeout": 100, "strokeColor": "0099FF", "fillColor": "220099FF", "beepOnResult": true, diff --git a/example/RNExampleApp/ios/RNExampleApp.xcodeproj/project.pbxproj b/example/RNExampleApp/ios/RNExampleApp.xcodeproj/project.pbxproj index d6bc774a..2064923b 100644 --- a/example/RNExampleApp/ios/RNExampleApp.xcodeproj/project.pbxproj +++ b/example/RNExampleApp/ios/RNExampleApp.xcodeproj/project.pbxproj @@ -11,15 +11,16 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + A0D22D4E2B7765BBDC78A44B /* libPods-RNExampleApp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0DC1B1AF20AF8AA68E9BDF79 /* libPods-RNExampleApp.a */; }; C2CD7DFC2B0C9835008D7B5E /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = C2CD7DFB2B0C9835008D7B5E /* main.jsbundle */; }; - CB5AFDA97FFD6EE6C9855F3B /* libPods-RNExampleApp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFA47AADA9F8ACCB61B613B /* libPods-RNExampleApp.a */; }; FA890E4F132C426FA299B3EE /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE894095EAC5430EA740D7E6 /* noop-file.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 00E356F21AD99517003FC87E /* RNExampleAppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNExampleAppTests.m; sourceTree = ""; }; - 0B9109B80D4672C0390A760D /* Pods-RNExampleAppTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNExampleAppTests.debug.xcconfig"; path = "Target Support Files/Pods-RNExampleAppTests/Pods-RNExampleAppTests.debug.xcconfig"; sourceTree = ""; }; + 0471DCE92150CE8186B97910 /* Pods-RNExampleApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNExampleApp.release.xcconfig"; path = "Target Support Files/Pods-RNExampleApp/Pods-RNExampleApp.release.xcconfig"; sourceTree = ""; }; + 0DC1B1AF20AF8AA68E9BDF79 /* libPods-RNExampleApp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNExampleApp.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07F961A680F5B00A75B9A /* RNExampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RNExampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = RNExampleApp/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = RNExampleApp/AppDelegate.m; sourceTree = ""; }; @@ -27,24 +28,14 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNExampleApp/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNExampleApp/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = RNExampleApp/main.m; sourceTree = ""; }; + 163E1AB21A075852986FB84E /* Pods-RNExampleApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNExampleApp.debug.xcconfig"; path = "Target Support Files/Pods-RNExampleApp/Pods-RNExampleApp.debug.xcconfig"; sourceTree = ""; }; 1797ADC7241CFCF900B339CB /* RNExampleApp.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = RNExampleApp.entitlements; path = RNExampleApp/RNExampleApp.entitlements; sourceTree = ""; }; - 19F05F1AF281F595FDCF1DB4 /* Pods-RNExampleApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNExampleApp.release.xcconfig"; path = "Target Support Files/Pods-RNExampleApp/Pods-RNExampleApp.release.xcconfig"; sourceTree = ""; }; - 1A02BC394DCD67A0F744AEAD /* libPods-RNExampleApp-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNExampleApp-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1F6978C873B894F00427D057 /* Pods-RNExampleApp-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNExampleApp-tvOSTests.debug.xcconfig"; path = "Target Support Files/Pods-RNExampleApp-tvOSTests/Pods-RNExampleApp-tvOSTests.debug.xcconfig"; sourceTree = ""; }; 452C21322E0C4777A31F466A /* SplashScreen.storyboard */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = SplashScreen.storyboard; path = RNExampleApp/SplashScreen.storyboard; sourceTree = ""; }; - 630ED0E8DE502A35F662F2A7 /* libPods-RNExampleApp-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNExampleApp-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 7BD9F9BCA1677A4389F93763 /* Pods-RNExampleApp-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNExampleApp-tvOS.release.xcconfig"; path = "Target Support Files/Pods-RNExampleApp-tvOS/Pods-RNExampleApp-tvOS.release.xcconfig"; sourceTree = ""; }; - 8BFA47AADA9F8ACCB61B613B /* libPods-RNExampleApp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNExampleApp.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A7ED9B19236344F400960E39 /* RNExampleApp-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RNExampleApp-Bridging-Header.h"; sourceTree = ""; }; - AC8870222FD454D589A2AACF /* Pods-RNExampleAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNExampleAppTests.release.xcconfig"; path = "Target Support Files/Pods-RNExampleAppTests/Pods-RNExampleAppTests.release.xcconfig"; sourceTree = ""; }; AE894095EAC5430EA740D7E6 /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "RNExampleApp/noop-file.swift"; sourceTree = ""; }; C2CD7DFB2B0C9835008D7B5E /* main.jsbundle */ = {isa = PBXFileReference; lastKnownFileType = text; name = main.jsbundle; path = "../node_modules/expo-dev-launcher/ios/main.jsbundle"; sourceTree = ""; }; - C7BE463B35863C4FF159AF64 /* Pods-RNExampleApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNExampleApp.debug.xcconfig"; path = "Target Support Files/Pods-RNExampleApp/Pods-RNExampleApp.debug.xcconfig"; sourceTree = ""; }; - D6503512B0087E9293DF3899 /* Pods-RNExampleApp-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNExampleApp-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-RNExampleApp-tvOS/Pods-RNExampleApp-tvOS.debug.xcconfig"; sourceTree = ""; }; - D94EA982436299AD85AD92A8 /* libPods-RNExampleAppTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNExampleAppTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; - F00A42543CEE07ABA44A7F94 /* Pods-RNExampleApp-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNExampleApp-tvOSTests.release.xcconfig"; path = "Target Support Files/Pods-RNExampleApp-tvOSTests/Pods-RNExampleApp-tvOSTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -52,7 +43,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - CB5AFDA97FFD6EE6C9855F3B /* libPods-RNExampleApp.a in Frameworks */, + A0D22D4E2B7765BBDC78A44B /* libPods-RNExampleApp.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -99,10 +90,7 @@ children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, ED2971642150620600B7C4FE /* JavaScriptCore.framework */, - 8BFA47AADA9F8ACCB61B613B /* libPods-RNExampleApp.a */, - 1A02BC394DCD67A0F744AEAD /* libPods-RNExampleApp-tvOS.a */, - 630ED0E8DE502A35F662F2A7 /* libPods-RNExampleApp-tvOSTests.a */, - D94EA982436299AD85AD92A8 /* libPods-RNExampleAppTests.a */, + 0DC1B1AF20AF8AA68E9BDF79 /* libPods-RNExampleApp.a */, ); name = Frameworks; sourceTree = ""; @@ -140,14 +128,8 @@ FE7947828549C734DB5231CD /* Pods */ = { isa = PBXGroup; children = ( - C7BE463B35863C4FF159AF64 /* Pods-RNExampleApp.debug.xcconfig */, - 19F05F1AF281F595FDCF1DB4 /* Pods-RNExampleApp.release.xcconfig */, - D6503512B0087E9293DF3899 /* Pods-RNExampleApp-tvOS.debug.xcconfig */, - 7BD9F9BCA1677A4389F93763 /* Pods-RNExampleApp-tvOS.release.xcconfig */, - 1F6978C873B894F00427D057 /* Pods-RNExampleApp-tvOSTests.debug.xcconfig */, - F00A42543CEE07ABA44A7F94 /* Pods-RNExampleApp-tvOSTests.release.xcconfig */, - 0B9109B80D4672C0390A760D /* Pods-RNExampleAppTests.debug.xcconfig */, - AC8870222FD454D589A2AACF /* Pods-RNExampleAppTests.release.xcconfig */, + 163E1AB21A075852986FB84E /* Pods-RNExampleApp.debug.xcconfig */, + 0471DCE92150CE8186B97910 /* Pods-RNExampleApp.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -159,14 +141,14 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "RNExampleApp" */; buildPhases = ( - D6F0B38747781911729D9A95 /* [CP] Check Pods Manifest.lock */, + 94471B16B51C3134E02549B7 /* [CP] Check Pods Manifest.lock */, FD10A7F022414F080027D42C /* Start Packager */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - 002C2435724AECBB056A7FBD /* [CP] Copy Pods Resources */, - 9269E38444549949A7BD6DE1 /* [CP] Embed Pods Frameworks */, + B0859C2CA2AEB28849560613 /* [CP] Embed Pods Frameworks */, + CB2C16BF806A9936C0355D0B /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -226,41 +208,43 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 002C2435724AECBB056A7FBD /* [CP] Copy Pods Resources */ = { + 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNExampleApp/Pods-RNExampleApp-resources.sh", - "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle", - "${PODS_ROOT}/Anyline/AnylineSDK_iOS_52.0.1/Framework/AnylineResources.bundle", ); - name = "[CP] Copy Pods Resources"; + name = "Bundle React Native code and images"; outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle", - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AnylineResources.bundle", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNExampleApp/Pods-RNExampleApp-resources.sh\"\n"; - showEnvVarsInLog = 0; + shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n"; }; - 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { + 94471B16B51C3134E02549B7 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - name = "Bundle React Native code and images"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RNExampleApp-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; }; - 9269E38444549949A7BD6DE1 /* [CP] Embed Pods Frameworks */ = { + B0859C2CA2AEB28849560613 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -280,26 +264,24 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNExampleApp/Pods-RNExampleApp-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - D6F0B38747781911729D9A95 /* [CP] Check Pods Manifest.lock */ = { + CB2C16BF806A9936C0355D0B /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNExampleApp/Pods-RNExampleApp-resources.sh", + "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle", + "${PODS_ROOT}/Anyline/AnylineSDK_iOS_53.0.0/Framework/AnylineResources.bundle", ); + name = "[CP] Copy Pods Resources"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RNExampleApp-checkManifestLockResult.txt", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AnylineResources.bundle", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNExampleApp/Pods-RNExampleApp-resources.sh\"\n"; showEnvVarsInLog = 0; }; FD10A7F022414F080027D42C /* Start Packager */ = { @@ -351,7 +333,7 @@ /* Begin XCBuildConfiguration section */ 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C7BE463B35863C4FF159AF64 /* Pods-RNExampleApp.debug.xcconfig */; + baseConfigurationReference = 163E1AB21A075852986FB84E /* Pods-RNExampleApp.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -365,7 +347,7 @@ INFOPLIST_FILE = RNExampleApp/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 52.0.1; + MARKETING_VERSION = 53.0.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -385,7 +367,7 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 19F05F1AF281F595FDCF1DB4 /* Pods-RNExampleApp.release.xcconfig */; + baseConfigurationReference = 0471DCE92150CE8186B97910 /* Pods-RNExampleApp.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -398,7 +380,7 @@ INFOPLIST_FILE = RNExampleApp/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 52.0.1; + MARKETING_VERSION = 53.0.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", diff --git a/example/RNExampleApp/package.json b/example/RNExampleApp/package.json index 9463cb55..6e3507fe 100644 --- a/example/RNExampleApp/package.json +++ b/example/RNExampleApp/package.json @@ -1,6 +1,6 @@ { "name": "react-native-example-app", - "version": "52.0.1", + "version": "53.0.0", "private": true, "scripts": { "initProject": "yarn add expo && yarn add ../../plugin", diff --git a/plugin/android/build.gradle b/plugin/android/build.gradle index 182139a1..8253c04e 100755 --- a/plugin/android/build.gradle +++ b/plugin/android/build.gradle @@ -61,7 +61,7 @@ repositories { dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) - implementation 'io.anyline:anylinesdk:52.0.1' + implementation 'io.anyline:anylinesdk:53.0.0' implementation "com.facebook.react:react-native:+" implementation("com.google.android.material:material:1.9.0") implementation 'androidx.multidex:multidex:2.0.1' diff --git a/plugin/android/src/main/java/com/anyline/reactnative/ScanActivity.java b/plugin/android/src/main/java/com/anyline/reactnative/ScanActivity.java index 93621f25..283008a9 100644 --- a/plugin/android/src/main/java/com/anyline/reactnative/ScanActivity.java +++ b/plugin/android/src/main/java/com/anyline/reactnative/ScanActivity.java @@ -124,6 +124,9 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { }; } catch (JSONException e) { finishWithError("Error parsing view config: " + e.getMessage()); + } catch (Exception e) { + finishWithError(getString(getResources().getIdentifier("error_invalid_json_data", "string", getPackageName())) + + "\n" + e.getLocalizedMessage()); } } else { finishWithError("View config not found"); @@ -370,6 +373,7 @@ private void finishWithError(String errorMessage) { Intent intent = new Intent(); intent.putExtra(EXTRA_ERROR_MESSAGE, errorMessage); setResult(RESULT_ERROR, intent); + ResultReporter.onError(errorMessage); finish(); } @@ -382,13 +386,17 @@ protected void onSaveInstanceState(Bundle outState) { @Override protected void onResume() { super.onResume(); - scanView.start(); + if (scanView.isInitialized()) { + scanView.start(); + } } @Override protected void onPause() { - scanView.stop(); - scanView.getCameraView().releaseCameraInBackground(); + if (scanView.isInitialized()) { + scanView.stop(); + scanView.getCameraView().releaseCameraInBackground(); + } super.onPause(); } diff --git a/plugin/ios/ALNFCScanViewController.m b/plugin/ios/ALNFCScanViewController.m index 58de924c..ea1e1fb4 100644 --- a/plugin/ios/ALNFCScanViewController.m +++ b/plugin/ios/ALNFCScanViewController.m @@ -109,7 +109,7 @@ - (void)viewDidLoad { return; } - self.mrzScanViewPlugin = (ALScanViewPlugin *)self.scanView.scanViewPlugin; + self.mrzScanViewPlugin = (ALScanViewPlugin *)self.scanView.viewPlugin; self.scanView.supportedNativeBarcodeFormats = self.uiConfig.nativeBarcodeFormats; self.scanView.delegate = self; @@ -155,7 +155,7 @@ - (void)stopMRZScanning { - (void)configureMRZPlugin { - ALScanViewPlugin *scanViewPlugin = (ALScanViewPlugin *)self.scanView.scanViewPlugin; + ALScanViewPlugin *scanViewPlugin = (ALScanViewPlugin *)self.scanView.viewPlugin; if (![scanViewPlugin isKindOfClass:ALScanViewPlugin.class]) { return; } @@ -183,14 +183,12 @@ - (void)configureMRZPlugin { mrzConfig.mrzMinFieldConfidences.dateOfExpiry = @(90); NSError *error; - ALScanViewPluginConfig *scanViewPluginConfig = [ALScanViewPluginConfig withPluginConfig:pluginConfig - cutoutConfig:cutoutConfig - scanFeedbackConfig:scanFeedbackConfig]; - ALScanViewPlugin *updatedScanViewPlugin = [[ALScanViewPlugin alloc] initWithConfig:scanViewPluginConfig error:&error]; - [self.scanView setScanViewPlugin:updatedScanViewPlugin error:&error]; + + ALViewPluginConfig *scanViewPluginConfig = scanViewPlugin.scanViewPluginConfig; + [self.scanView setViewPluginConfig:scanViewPluginConfig error:&error]; // the delegate binding was lost when you recreated the ScanPlugin it so you have to bring it back here - scanViewPlugin = (ALScanViewPlugin *)self.scanView.scanViewPlugin; + scanViewPlugin = (ALScanViewPlugin *)self.scanView.viewPlugin; scanViewPlugin.scanPlugin.delegate = self; } @@ -243,7 +241,7 @@ - (void)handleResult:(id _Nullable)resultObj { resultDictionary[@"nativeBarcodesDetected"] = self.detectedBarcodes; } - NSObject *scanViewPluginBase = self.scanView.scanViewPlugin; + NSObject *scanViewPluginBase = self.scanView.viewPlugin; if ([scanViewPluginBase isKindOfClass:ALScanViewPlugin.class]) { ALScanViewPlugin *scanViewPlugin = (ALScanViewPlugin *)scanViewPluginBase; BOOL cancelOnResult = scanViewPlugin.scanPlugin.pluginConfig.cancelOnResult; diff --git a/plugin/ios/ALPluginHelper.h b/plugin/ios/ALPluginHelper.h index 45527127..33c5b9e3 100644 --- a/plugin/ios/ALPluginHelper.h +++ b/plugin/ios/ALPluginHelper.h @@ -5,7 +5,7 @@ NS_ASSUME_NONNULL_BEGIN @class ALPluginConfig; -typedef void (^ALPluginCallback)(id _Nullable callbackObj, NSString * _Nullable errorString); +typedef void (^ALPluginCallback)(NSDictionary * _Nullable callbackObj, NSError * _Nullable error); @interface ALPluginHelper : NSObject diff --git a/plugin/ios/ALPluginHelper.m b/plugin/ios/ALPluginHelper.m index 8237a144..baeb370e 100644 --- a/plugin/ios/ALPluginHelper.m +++ b/plugin/ios/ALPluginHelper.m @@ -27,7 +27,8 @@ + (void)startScan:(NSDictionary *)config finished:(ALPluginCallback)callback { if (@available(iOS 13.0, *)) { if (![ALNFCDetector readingAvailable]) { - callback(nil, @"NFC passport reading is not supported on this device or app."); + callback(nil, [NSError errorWithDomain:@"ALReactDomain" code:100 userInfo:@{@"Error reason": @"NFC passport reading is not supported on this device or app."}]); + return; } @@ -42,7 +43,7 @@ + (void)startScan:(NSDictionary *)config finished:(ALPluginCallback)callback { completion:nil]; } } else { - callback(nil, @"NFC passport reading is only supported on iOS 13 and later."); + callback(nil,[NSError errorWithDomain:@"ALReactDomain" code:100 userInfo:@{@"Error reason": @"NFC passport reading is only supported on iOS 13 and later."}]); return; } } else { @@ -288,7 +289,7 @@ + (BOOL)showErrorAlertIfNeeded:(NSError *)error pluginCallback:(ALPluginCallback [[UIApplication sharedApplication].keyWindow.rootViewController dismissViewControllerAnimated:YES completion:^{ - callback(nil, @"Canceled"); + callback(nil, [NSError errorWithDomain:@"" code:-1 userInfo:@{@"Error reason": @"Canceled"}]); }]; }]; diff --git a/plugin/ios/ALPluginScanViewController.m b/plugin/ios/ALPluginScanViewController.m index 3176ffdb..f9f02732 100644 --- a/plugin/ios/ALPluginScanViewController.m +++ b/plugin/ios/ALPluginScanViewController.m @@ -35,6 +35,8 @@ @interface ALPluginScanViewController () *scanViewPluginBase = self.scanView.scanViewPlugin; + NSObject *scanViewPluginBase = self.scanView.viewPlugin; if ([scanViewPluginBase isKindOfClass:ALScanViewPlugin.class]) { ALScanViewPlugin *scanViewPlugin = (ALScanViewPlugin *)scanViewPluginBase; BOOL cancelOnResult = scanViewPlugin.scanPlugin.pluginConfig.cancelOnResult; @@ -289,7 +299,7 @@ - (void)scanView:(ALScanView *)scanView didReceiveNativeBarcodeResult:(ALScanRes - (ALPluginConfig * _Nullable)pluginConfig { // applic. only to non-composites - NSObject *scanVwPluginBase = self.scanView.scanViewPlugin; + NSObject *scanVwPluginBase = self.scanView.viewPlugin; if ([scanVwPluginBase isKindOfClass:ALScanViewPlugin.class]) { return ((ALScanViewPlugin *)scanVwPluginBase).scanPlugin.pluginConfig; } @@ -299,11 +309,11 @@ - (ALPluginConfig * _Nullable)pluginConfig { // MARK: - Selector Actions - (void)doneButtonPressed:(id)sender { - [self.scanView.scanViewPlugin stop]; + [self.scanView.viewPlugin stop]; __weak __block typeof(self) weakSelf = self; [self dismissViewControllerAnimated:YES completion:^{ - weakSelf.callback(nil, @"Canceled"); + weakSelf.callback(nil, [NSError errorWithDomain:@"ALReactDomain" code:-1 userInfo:@{NSLocalizedDescriptionKey: @"Canceled"}]); }]; } @@ -356,25 +366,23 @@ - (void)updateScanModeWithValue:(NSString *)modeString { // assume that pluginConfig carries the updated scanMode or whatever value that you wish to refresh. - (BOOL)updatePluginConfig:(ALPluginConfig *)pluginConfig error:(NSError * _Nullable * _Nullable)error { - ALScanViewPluginConfig *origSVPConfig = ((ALScanViewPlugin *)self.scanView.scanViewPlugin).scanViewPluginConfig; - ALScanViewPluginConfig *scanViewPluginConfig = [ALScanViewPluginConfig withPluginConfig:pluginConfig - cutoutConfig:origSVPConfig.cutoutConfig - scanFeedbackConfig:origSVPConfig.scanFeedbackConfig]; - ALScanViewPlugin *newScanViewPlugin = [[ALScanViewPlugin alloc] initWithConfig:scanViewPluginConfig error:error]; - if (!newScanViewPlugin) { - return NO; - } - - newScanViewPlugin.scanPlugin.delegate = self; + ALViewPluginConfig *origSVPConfig = ((ALScanViewPlugin *)self.scanView.viewPlugin).scanViewPluginConfig; - BOOL success = [self.scanView setScanViewPlugin:newScanViewPlugin error:error]; + origSVPConfig.pluginConfig = pluginConfig; + BOOL success = [self.scanView setViewPluginConfig:origSVPConfig error:error]; if (!success) { + if([self showErrorAlertIfNeeded:*error]){ + [self dismissOnError:*error]; + } return NO; } - success = [[self.scanView scanViewPlugin] startWithError:error]; + success = [self.scanView.viewPlugin startWithError:error]; if (!success) { // check error + if([self showErrorAlertIfNeeded:*error]){ + [self dismissOnError:*error]; + } return NO; } return YES; @@ -429,7 +437,18 @@ - (BOOL)segmentModesAreValid { // MARK: - Miscellaneous - (BOOL)showErrorAlertIfNeeded:(NSError *)error { - return [ALPluginHelper showErrorAlertIfNeeded:error pluginCallback:self.callback]; + if (!error) { + return NO; + } + + return YES; } +-(void)dismissOnError:(NSError *)error{ + [self dismissViewControllerAnimated:YES completion:^{ + self.callback(nil, error); + }]; +} + + @end diff --git a/plugin/ios/AnylineReact.podspec b/plugin/ios/AnylineReact.podspec index fcbb6bf5..eb2ec02c 100644 --- a/plugin/ios/AnylineReact.podspec +++ b/plugin/ios/AnylineReact.podspec @@ -18,7 +18,7 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/Anyline/anyline-ocr-react-native-module.git", :tag => "#{s.version}" } s.source_files = "*.{h,m}" - s.dependency "Anyline", "~> 52" + s.dependency "Anyline", "53.0.0" s.dependency "React" end \ No newline at end of file diff --git a/plugin/ios/AnylineSDKPlugin.m b/plugin/ios/AnylineSDKPlugin.m index f680a68d..9e1bb18a 100644 --- a/plugin/ios/AnylineSDKPlugin.m +++ b/plugin/ios/AnylineSDKPlugin.m @@ -10,7 +10,7 @@ @interface AnylineSDKPlugin() -@property (nonatomic, strong) ALScanViewPluginConfig *conf; +@property (nonatomic, strong) ALViewPluginConfig *conf; @property (nonatomic, copy) NSString *callbackId; @property (nonatomic, copy) NSString *appKey; @@ -83,7 +83,7 @@ - (UIView *)view { if (!success) { NSLog(@"error: %@", error.localizedDescription); errorString = @"Unable to initialize the Anyline SDK. Please check your license key."; - [self returnError:errorString]; + [self returnError:[NSError errorWithDomain:@"ALReactDomain" code:100 userInfo:@{@"Error reason": errorString}]]; return; } @@ -127,7 +127,7 @@ - (UIView *)view { if (!exportPath) { NSString *errorString = @"Event cache is empty."; - [self returnError:errorString]; + [self returnError:[NSError errorWithDomain:@"ALReactDomain" code:100 userInfo:@{@"Error reason": errorString}]]; } else { [self returnSuccess:exportPath]; } @@ -158,7 +158,7 @@ - (void)initView:(NSString *)scanMode { self.nativeBarcodeScanning = nativeBarcodeScanning ? nativeBarcodeScanning : NO; self.jsonUIConf = [[ALJSONUIConfiguration alloc] initWithDictionary:optionsDictionary]; - self.conf = [[ALScanViewPluginConfig alloc] initWithJSONDictionary:optionsDictionary error:&error]; + self.conf = [[ALViewPluginConfig alloc] initWithJSONDictionary:optionsDictionary error:&error]; self.ocrConfigDict = [dictionary objectForKey:@"ocr"]; dispatch_async(dispatch_get_main_queue(), ^{ @@ -172,8 +172,8 @@ - (void)initView:(NSString *)scanMode { ALNFCScanViewController *nfcScanViewController = [[ALNFCScanViewController alloc] initWithLicensekey:self.appKey configuration:dictionary uiConfig:self.jsonUIConf - finished:^(id _Nullable callbackObj, NSString * _Nullable errorString) { - [self returnCallback:callbackObj andErrorString:errorString]; + finished:^(NSDictionary * _Nullable callbackObj, NSError * _Nullable error) { + [self returnCallback:callbackObj andError:error]; }]; if (nfcScanViewController != nil){ @@ -181,17 +181,18 @@ - (void)initView:(NSString *)scanMode { [[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController:nfcScanViewController animated:YES completion:nil]; } } else { - [self returnError:@"NFC passport reading is not supported on this device or app."]; + [self returnError:[NSError errorWithDomain:@"ALReactDomain" code:100 userInfo:@{@"Error reason": @"NFC passport reading is not supported on this device or app."}]]; } } else { - [self returnError:@"NFC passport reading is only supported on iOS 13 and later."]; + [self returnError:[NSError errorWithDomain:@"ALReactDomain" code:100 userInfo:@{@"Error reason": @"NFC passport reading is only supported on iOS 13 and later."}]]; + } } else { ALPluginScanViewController *pluginScanViewController = [[ALPluginScanViewController alloc] initWithLicensekey:self.appKey configuration:dictionary - uiConfiguration:self.jsonUIConf finished:^(id _Nullable callbackObj, NSString * _Nullable errorString) { - [self returnCallback:callbackObj andErrorString:errorString]; + uiConfiguration:self.jsonUIConf finished:^(NSDictionary * _Nullable callbackObj, NSError * _Nullable error) { + [self returnCallback:callbackObj andError:error]; }]; if (pluginScanViewController != nil){ @@ -203,8 +204,8 @@ - (void)initView:(NSString *)scanMode { ALPluginScanViewController *pluginScanViewController = [[ALPluginScanViewController alloc] initWithLicensekey:self.appKey configuration:dictionary - uiConfiguration:self.jsonUIConf finished:^(id _Nullable callbackObj, NSString * _Nullable errorString) { - [self returnCallback:callbackObj andErrorString:errorString]; + uiConfiguration:self.jsonUIConf finished:^(NSDictionary * _Nullable callbackObj, NSError * _Nullable error) { + [self returnCallback:callbackObj andError:error]; }]; if (pluginScanViewController != nil){ @@ -235,11 +236,11 @@ - (void)pluginScanViewController:(nonnull ALPluginScanViewController *)pluginSca } - (void)pluginScanViewController:(nonnull ALPluginScanViewController *)pluginScanViewController didStopScanning:(nonnull id)sender { - [self returnError:(@"Canceled")]; + [self returnError: [NSError errorWithDomain:@"ALReactDomain" code:100 userInfo:@{@"Error reason": @"Canceled"}]]; } - (void)pluginScanViewController:(ALPluginScanViewController *)pluginScanViewController didStopScanning:(id)sender error:(NSError *)error { - [self returnError:error.debugDescription]; + [self returnError:error]; } - (BOOL)scanModeIndex:(NSString *)scanMode{ @@ -251,20 +252,20 @@ - (BOOL)scanModeIndex:(NSString *)scanMode{ } -- (void)returnCallback:(id _Nullable)callbackObj andErrorString:(NSString * _Nullable)errorString { +- (void)returnCallback:(id _Nullable)callbackObj andError:(NSError * _Nullable)error { NSString *resultStr; - NSError *error; - if (errorString) { - [self returnError:errorString]; + NSError *errorObj; + if (error) { + [self returnError:error]; } else if ([NSJSONSerialization isValidJSONObject:callbackObj]) { - resultStr = [(NSDictionary *)callbackObj toJSONStringPretty:YES error:&error]; - if (error) { - [self returnError:error.debugDescription]; + resultStr = [(NSDictionary *)callbackObj toJSONStringPretty:YES error:&errorObj]; + if (errorObj) { + [self returnError:errorObj]; } [self returnSuccess:resultStr]; } else { resultStr = @"callback object should be of JSON type"; - [self returnError:resultStr]; + [self returnError:[NSError errorWithDomain:@"ALReactDomain" code:100 userInfo:@{NSLocalizedDescriptionKey: resultStr}]]; } } @@ -276,11 +277,11 @@ - (void)returnSuccess:(NSString *)result { } } -- (void)returnError:(NSString *)error { +- (void)returnError:(NSError *)error { if ([self.returnMethod isEqualToString:@"callback"]) { self.onErrorCallback(@[error]); } else if ([self.returnMethod isEqualToString:@"promise"]) { - _rejectBlock(@"ANYLINE_ERROR", error, nil); + _rejectBlock(@"ANYLINE_ERROR", error.localizedDescription, error); } } diff --git a/plugin/package.json b/plugin/package.json index 11f33208..c9dd0009 100644 --- a/plugin/package.json +++ b/plugin/package.json @@ -1,6 +1,6 @@ { - "_from": "anyline-ocr-react-native-module@^52.0.1", - "_id": "anyline-ocr-react-native-module@^52.0.1", + "_from": "anyline-ocr-react-native-module@^53.0.0", + "_id": "anyline-ocr-react-native-module@^53.0.0", "_inBundle": false, "_integrity": "sha512-BGi9zNkSsoxXywDBIqzgBRvKUBniQOJHDKBrozZubKthZNRBAj8Ry5tW0Me0yLXt/fauME//hbC0wsenfPJZqw==", "_location": "/anyline-ocr-react-native-module", @@ -8,19 +8,19 @@ "_requested": { "type": "range", "registry": true, - "raw": "anyline-ocr-react-native-module@^52.0.1", + "raw": "anyline-ocr-react-native-module@^53.0.0", "name": "anyline-ocr-react-native-module", "escapedName": "anyline-ocr-react-native-module", - "rawSpec": "^52.0.1", + "rawSpec": "^53.0.0", "saveSpec": null, - "fetchSpec": "^52.0.1" + "fetchSpec": "^53.0.0" }, "_requiredBy": [ "/" ], - "_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-52.0.1.tgz", + "_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-53.0.0.tgz", "_shasum": "bacbcd260cc662244f59393ed81a6edba009b52c", - "_spec": "anyline-ocr-react-native-module@^52.0.1", + "_spec": "anyline-ocr-react-native-module@^53.0.0", "_where": "/Users/amiransari/Projects/anyline-ocr-react-native-module1/example/RNExampleApp", "bugs": { "url": "https://github.com/Anyline/anyline-ocr-react-native-module/issues" @@ -47,5 +47,5 @@ "type": "git", "url": "git+https://github.com/Anyline/anyline-ocr-react-native-module.git" }, - "version": "52.0.1" + "version": "53.0.0" }