Преглед на файлове

ERP Mobile compatible fix

Ray Zhang преди 2 години
родител
ревизия
0a3673a829

+ 2 - 46
RedAnt ERP Mobile/HMLG Scan Order.xcodeproj/project.pbxproj

@@ -91,7 +91,6 @@
 		3CABBF122836224500FA3352 /* guest.json in Resources */ = {isa = PBXBuildFile; fileRef = 3CABBF112836224400FA3352 /* guest.json */; };
 		3CABE0202861A51F00CF0DC1 /* StockViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CABE01F2861A51E00CF0DC1 /* StockViewController.m */; };
 		3CABE0232861A5E000CF0DC1 /* StockTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CABE0222861A5E000CF0DC1 /* StockTableViewCell.m */; };
-		3CB44F1028733D6D00E24494 /* libScanApiCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CB44F0F28733D1200E24494 /* libScanApiCore.a */; };
 		3CC1122B279163F4004ACA57 /* offline_order_new_contact.json in Resources */ = {isa = PBXBuildFile; fileRef = 3CC1122A279163F4004ACA57 /* offline_order_new_contact.json */; };
 		3CD54A79282CF21D0073A15D /* ScanHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CD54A78282CF21D0073A15D /* ScanHomeViewController.m */; };
 		3CD54A7C282CF4930073A15D /* ScanHomeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CD54A7B282CF4930073A15D /* ScanHomeCell.m */; };
@@ -162,10 +161,6 @@
 		714036F921646B8C0029B10F /* AppDelegateBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 714036F721646B8C0029B10F /* AppDelegateBase.m */; };
 		714036FC21646CFF0029B10F /* UIResponder+Router.m in Sources */ = {isa = PBXBuildFile; fileRef = 714036FA21646CFF0029B10F /* UIResponder+Router.m */; };
 		714037052164707E0029B10F /* MainHeaderViewColorPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = 714037042164707D0029B10F /* MainHeaderViewColorPanel.m */; };
-		7141DD341C57269B00F7DF59 /* include in Resources */ = {isa = PBXBuildFile; fileRef = 7141DD331C57269B00F7DF59 /* include */; };
-		7141DD3B1C5726B700F7DF59 /* DeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 7141DD361C5726B700F7DF59 /* DeviceInfo.m */; };
-		7141DD3C1C5726B700F7DF59 /* ScanApiHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7141DD381C5726B700F7DF59 /* ScanApiHelper.mm */; };
-		7141DD3D1C5726B700F7DF59 /* softScanBeep.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7141DD3A1C5726B700F7DF59 /* softScanBeep.wav */; };
 		7141DD4E1C57459B00F7DF59 /* bitstream.c in Sources */ = {isa = PBXBuildFile; fileRef = 7141DD3E1C57459B00F7DF59 /* bitstream.c */; };
 		7141DD4F1C57459B00F7DF59 /* mask.c in Sources */ = {isa = PBXBuildFile; fileRef = 7141DD401C57459B00F7DF59 /* mask.c */; };
 		7141DD501C57459B00F7DF59 /* QRCodeGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 7141DD431C57459B00F7DF59 /* QRCodeGenerator.m */; };
@@ -475,8 +470,6 @@
 		3CABE01F2861A51E00CF0DC1 /* StockViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StockViewController.m; sourceTree = "<group>"; };
 		3CABE0212861A5E000CF0DC1 /* StockTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StockTableViewCell.h; sourceTree = "<group>"; };
 		3CABE0222861A5E000CF0DC1 /* StockTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StockTableViewCell.m; sourceTree = "<group>"; };
-		3CB44F0E28733CEC00E24494 /* ScanAPI.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; name = ScanAPI.podspec; path = "ScanApiSDK-10.2.227-2/ScanAPI.podspec"; sourceTree = "<group>"; };
-		3CB44F0F28733D1200E24494 /* libScanApiCore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libScanApiCore.a; path = "ScanApiSDK-10.2.227-2/lib/libScanApiCore.a"; sourceTree = "<group>"; };
 		3CBC872A2A4EBEDC00978758 /* ScanRefreshStock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ScanRefreshStock.h; path = common/ScanRefreshStock.h; sourceTree = SOURCE_ROOT; };
 		3CC1122A279163F4004ACA57 /* offline_order_new_contact.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = offline_order_new_contact.json; path = common/Functions/contact/offline_order_new_contact.json; sourceTree = SOURCE_ROOT; };
 		3CD54A77282CF21D0073A15D /* ScanHomeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScanHomeViewController.h; sourceTree = "<group>"; };
@@ -606,13 +599,6 @@
 		714036FB21646CFF0029B10F /* UIResponder+Router.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIResponder+Router.h"; path = "common/UIResponder+Router.h"; sourceTree = SOURCE_ROOT; };
 		714037032164707D0029B10F /* MainHeaderViewColorPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MainHeaderViewColorPanel.h; path = common/Functions/MainHeaderViewColorPanel.h; sourceTree = SOURCE_ROOT; };
 		714037042164707D0029B10F /* MainHeaderViewColorPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MainHeaderViewColorPanel.m; path = common/Functions/MainHeaderViewColorPanel.m; sourceTree = SOURCE_ROOT; };
-		7141DD331C57269B00F7DF59 /* include */ = {isa = PBXFileReference; lastKnownFileType = folder; name = include; path = "ScanApiSDK-10.2.227-2/include"; sourceTree = SOURCE_ROOT; };
-		7141DD351C5726B700F7DF59 /* DeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeviceInfo.h; path = "ScanApiSDK-10.2.227-2/DeviceInfo.h"; sourceTree = SOURCE_ROOT; };
-		7141DD361C5726B700F7DF59 /* DeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DeviceInfo.m; path = "ScanApiSDK-10.2.227-2/DeviceInfo.m"; sourceTree = SOURCE_ROOT; };
-		7141DD371C5726B700F7DF59 /* ScanApiHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScanApiHelper.h; path = "ScanApiSDK-10.2.227-2/ScanApiHelper.h"; sourceTree = SOURCE_ROOT; };
-		7141DD381C5726B700F7DF59 /* ScanApiHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScanApiHelper.mm; path = "ScanApiSDK-10.2.227-2/ScanApiHelper.mm"; sourceTree = SOURCE_ROOT; };
-		7141DD391C5726B700F7DF59 /* ScanApiIncludes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScanApiIncludes.h; path = "ScanApiSDK-10.2.227-2/ScanApiIncludes.h"; sourceTree = SOURCE_ROOT; };
-		7141DD3A1C5726B700F7DF59 /* softScanBeep.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = softScanBeep.wav; path = "ScanApiSDK-10.2.227-2/softScanBeep.wav"; sourceTree = SOURCE_ROOT; };
 		7141DD3E1C57459B00F7DF59 /* bitstream.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bitstream.c; path = common/qrcode/bitstream.c; sourceTree = SOURCE_ROOT; };
 		7141DD3F1C57459B00F7DF59 /* bitstream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bitstream.h; path = common/qrcode/bitstream.h; sourceTree = SOURCE_ROOT; };
 		7141DD401C57459B00F7DF59 /* mask.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mask.c; path = common/qrcode/mask.c; sourceTree = SOURCE_ROOT; };
@@ -819,11 +805,9 @@
 		716AF8E61D7AA398001188E0 /* SelectOrderTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelectOrderTableViewCell.h; path = common/Functions/offline/SelectOrderTableViewCell.h; sourceTree = SOURCE_ROOT; };
 		7186C25B1C97A6EE00CB43F4 /* FunctionTestViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FunctionTestViewController.h; path = common/Functions/sidemenu/FunctionTestViewController.h; sourceTree = SOURCE_ROOT; };
 		7186C25C1C97A6EE00CB43F4 /* FunctionTestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FunctionTestViewController.m; path = common/Functions/sidemenu/FunctionTestViewController.m; sourceTree = SOURCE_ROOT; };
-		718716221C433D5000F25860 /* libScanApiCore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libScanApiCore.a; path = ../lib/libScanApiCore.a; sourceTree = "<group>"; };
 		718716241C433D8B00F25860 /* ExternalAccessory.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExternalAccessory.framework; path = System/Library/Frameworks/ExternalAccessory.framework; sourceTree = SDKROOT; };
 		718716261C433D9700F25860 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
 		718716281C433DA400F25860 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
-		7187162A1C43406300F25860 /* libScanApiCore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libScanApiCore.a; path = "../../../ios_samples/ScanApiSDK-10.2.227/lib/libScanApiCore.a"; sourceTree = "<group>"; };
 		7195623A1CF57D1800C74A49 /* CategoryHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CategoryHeaderView.h; path = common/Functions/category/CategoryHeaderView.h; sourceTree = SOURCE_ROOT; };
 		7195623B1CF57D1800C74A49 /* CategoryHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CategoryHeaderView.m; path = common/Functions/category/CategoryHeaderView.m; sourceTree = SOURCE_ROOT; };
 		71BBA2211CEAC16000C91DED /* ZipArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZipArchive.h; path = common/zip/ZipArchive.h; sourceTree = SOURCE_ROOT; };
@@ -913,7 +897,6 @@
 				42D9A0231EB02DA6008AF7AF /* AdSupport.framework in Frameworks */,
 				42BEF35F1E89FEE300632AB6 /* CoreData.framework in Frameworks */,
 				42BEF35D1E89FECD00632AB6 /* SystemConfiguration.framework in Frameworks */,
-				3CB44F1028733D6D00E24494 /* libScanApiCore.a in Frameworks */,
 				71BBA2291CEAC17E00C91DED /* libz.tbd in Frameworks */,
 				718716291C433DA400F25860 /* AVFoundation.framework in Frameworks */,
 				718716271C433D9700F25860 /* AudioToolbox.framework in Frameworks */,
@@ -1163,8 +1146,6 @@
 		42BEF35B1E89FECC00632AB6 /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
-				3CB44F0F28733D1200E24494 /* libScanApiCore.a */,
-				3CB44F0E28733CEC00E24494 /* ScanAPI.podspec */,
 				42D9A0221EB02DA6008AF7AF /* AdSupport.framework */,
 				42BEF35E1E89FEE300632AB6 /* CoreData.framework */,
 				42BEF35C1E89FECD00632AB6 /* SystemConfiguration.framework */,
@@ -1281,11 +1262,9 @@
 			isa = PBXGroup;
 			children = (
 				71BBA2281CEAC17E00C91DED /* libz.tbd */,
-				7187162A1C43406300F25860 /* libScanApiCore.a */,
 				718716281C433DA400F25860 /* AVFoundation.framework */,
 				718716261C433D9700F25860 /* AudioToolbox.framework */,
 				718716241C433D8B00F25860 /* ExternalAccessory.framework */,
-				718716221C433D5000F25860 /* libScanApiCore.a */,
 				716961B419594E1000B19FB4 /* libsqlite3.dylib */,
 				71DEE875192DE00E003F645F /* Accelerate.framework */,
 				71DEE873192DE003003F645F /* QuartzCore.framework */,
@@ -1308,7 +1287,6 @@
 				71DF742C1C57567800F2789C /* HMLG SO */,
 				712AFEE31DBDAEA000254965 /* PDFResource */,
 				716387C71953CDB4006E65E6 /* utils */,
-				718716141C433B4300F25860 /* ScanAPI */,
 				7190F1091BBBCAF100B2F243 /* PDF+Web */,
 				714C6ADA1B83016A000123E3 /* address */,
 				71F731FC192F395000F2CF76 /* AutoScrollImage */,
@@ -1703,20 +1681,6 @@
 			name = customUI;
 			sourceTree = "<group>";
 		};
-		718716141C433B4300F25860 /* ScanAPI */ = {
-			isa = PBXGroup;
-			children = (
-				7141DD351C5726B700F7DF59 /* DeviceInfo.h */,
-				7141DD361C5726B700F7DF59 /* DeviceInfo.m */,
-				7141DD371C5726B700F7DF59 /* ScanApiHelper.h */,
-				7141DD381C5726B700F7DF59 /* ScanApiHelper.mm */,
-				7141DD391C5726B700F7DF59 /* ScanApiIncludes.h */,
-				7141DD3A1C5726B700F7DF59 /* softScanBeep.wav */,
-				7141DD331C57269B00F7DF59 /* include */,
-			);
-			name = ScanAPI;
-			sourceTree = "<group>";
-		};
 		7190F1091BBBCAF100B2F243 /* PDF+Web */ = {
 			isa = PBXGroup;
 			children = (
@@ -2091,12 +2055,10 @@
 				3CC1122B279163F4004ACA57 /* offline_order_new_contact.json in Resources */,
 				3C6831562396082800AD5BD7 /* ERP_Mobile_Discard.storyboard in Resources */,
 				7162A55F1C58724700AB630E /* customer_info_template.json in Resources */,
-				7141DD3D1C5726B700F7DF59 /* softScanBeep.wav in Resources */,
 				3C68316F2396094200AD5BD7 /* iPadCommonEditorCellModel.xib in Resources */,
 				3C3A5B0327D87BA1005F4EFB /* SO.storyboard in Resources */,
 				4295AE1D1FE74D46007BE365 /* CommonEditorAutoCompleteView.xib in Resources */,
 				3C872A1E27955CF300BE1FC8 /* scan_cart.json in Resources */,
-				7141DD341C57269B00F7DF59 /* include in Resources */,
 				7141DD601C5747CE00F7DF59 /* LICENSE in Resources */,
 				3C68314D239607B500AD5BD7 /* ytplayer.html in Resources */,
 				71D01ADD1E08CB1C006620CE /* signature.storyboard in Resources */,
@@ -2144,7 +2106,6 @@
 				3C51495C273D099600F78617 /* EnumSelectorCell.m in Sources */,
 				3C51494C273D095900F78617 /* CommonEditorCellMAction.m in Sources */,
 				7162A59D1C58733400AB630E /* OrderDetailViewController.m in Sources */,
-				7141DD3B1C5726B700F7DF59 /* DeviceInfo.m in Sources */,
 				714037052164707E0029B10F /* MainHeaderViewColorPanel.m in Sources */,
 				712AFEDC1DBA050200254965 /* PDFDrawable.m in Sources */,
 				7195623C1CF57D1800C74A49 /* CategoryHeaderView.m in Sources */,
@@ -2359,7 +2320,6 @@
 				42BF67CC1E5179970081F90A /* ERPUtils.m in Sources */,
 				42FD1A031FBD1A3000C5D9A8 /* RAOrderPreviewController.m in Sources */,
 				3C8855AA27E85A0C005DC3FA /* ScanCartItemCell.m in Sources */,
-				7141DD3C1C5726B700F7DF59 /* ScanApiHelper.mm in Sources */,
 				7162A5261C58706C00AB630E /* CategoryViewController.m in Sources */,
 				7162A50A1C586FC100AB630E /* NSTimer+Addition.m in Sources */,
 				3C3A5AFE27D74E50005F4EFB /* ScanResultViewController.m in Sources */,
@@ -2449,9 +2409,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/include";
 				IPHONEOS_DEPLOYMENT_TARGET = 15.0;
-				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = 2;
@@ -2500,9 +2458,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/include";
 				IPHONEOS_DEPLOYMENT_TARGET = 15.0;
-				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = 2;
 				VALIDATE_PRODUCT = YES;
@@ -2530,7 +2486,7 @@
 				GCC_PREFIX_HEADER = "HMLG Scan Order/HMLG Scan Order-Prefix.pch";
 				INFOPLIST_FILE = "$(SRCROOT)/HMLG Scan Order/HMLG Scan Order-Info.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 15.0;
-				MARKETING_VERSION = 1.39;
+				MARKETING_VERSION = 1.40;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",
@@ -2576,7 +2532,7 @@
 				GCC_PREFIX_HEADER = "HMLG Scan Order/HMLG Scan Order-Prefix.pch";
 				INFOPLIST_FILE = "$(SRCROOT)/HMLG Scan Order/HMLG Scan Order-Info.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 15.0;
-				MARKETING_VERSION = 1.39;
+				MARKETING_VERSION = 1.40;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",

+ 16 - 9
RedAnt ERP Mobile/common/AppDelegateBase.h

@@ -7,7 +7,10 @@
 //
 
 #import <UIKit/UIKit.h>
-#import "ScanApiHelper.h"
+#import "config.h"
+#ifdef USE_MFI_SCANNER
+    #import "ScanApiHelper.h"
+#endif
 #import "config.h"
 #import "UIResponder+Router.h"
 #import "iSalesDB.h"
@@ -15,8 +18,7 @@
 #import <CoreBluetooth/CoreBluetooth.h>
 
 #ifdef SCANNER_ORDER
-#import "RAUploadManager.h"
-
+    #import "RAUploadManager.h"
 #endif
 @protocol ScannerEventsFeedback <NSObject>
 -(void) onDecodedData:(NSString*) value;
@@ -33,11 +35,15 @@ typedef enum {
 } CustomerType;
 #ifdef USE_BLE_SCANNER
 @interface AppDelegateBase : UIResponder<UIApplicationDelegate , NSURLConnectionDataDelegate
-,ScanApiHelperDelegate,CBCentralManagerDelegate, CBPeripheralDelegate,NSURLSessionDataDelegate>
+,CBCentralManagerDelegate, CBPeripheralDelegate,NSURLSessionDataDelegate>
 #else
-@interface AppDelegateBase : UIResponder<UIApplicationDelegate , NSURLConnectionDataDelegate
-,ScanApiHelperDelegate,NSURLSessionDataDelegate>
-
+    #ifdef USE_MFI_SCANNER
+    @interface AppDelegateBase : UIResponder<UIApplicationDelegate , NSURLConnectionDataDelegate
+    ,ScanApiHelperDelegate,NSURLSessionDataDelegate>
+    #else
+    @interface AppDelegateBase : UIResponder<UIApplicationDelegate , NSURLConnectionDataDelegate
+    ,NSURLSessionDataDelegate>
+    #endif
 #endif
 //{
 //        id<ScannerEventsFeedback> _eventsFeedback;
@@ -58,8 +64,9 @@ typedef enum {
 #define API_INIT 0
 #define API_CLOSING 2
 
-
-@property (strong, nonatomic) ScanApiHelper* ScanApi;
+#ifdef USE_MFI_SCANNER
+    @property (strong, nonatomic) ScanApiHelper* ScanApi;
+#endif
 @property (strong, nonatomic) NSTimer* ScanApiConsumer;
 @property (nonatomic) BOOL doAppDataConfirmation;
 @property (strong, nonatomic) NSString *scanApiVersion;

+ 68 - 53
RedAnt ERP Mobile/common/AppDelegateBase.m

@@ -52,16 +52,22 @@
 @end
 @implementation AppDelegateBase
 {
-#ifdef USE_SOFTSCAN
-    DeviceInfo* _softScanDeviceInfo;
-#endif
+#ifdef USE_MFI_SCANNER
+    
     DeviceInfo* _deviceInfoToTrigger;
+#endif
+
     
     NSMutableArray* _feedbackStack;
     
     id<ScannerEventsFeedback> _eventsFeedback;
 }
+
+#ifdef USE_MFI_SCANNER
+    
 @synthesize ScanApi;
+#endif
+
 @synthesize ScanApiConsumer;
 @synthesize scanApiVersion;
 @synthesize price_hidden = _price_hidden;
@@ -2748,10 +2754,15 @@ void UncaughtExceptionHandler(NSException *exception) {
 //{
 //    [self.arr_scannerReceiver addObject:classname];
 //}
--(void) setScannerDelegate:(id<ScanApiHelperDelegate>)delegate
-{
-    [ScanApi setDelegate:delegate];
-}
+
+
+#ifdef USE_MFI_SCANNER
+    -(void) setScannerDelegate:(id<ScanApiHelperDelegate>)delegate
+    {
+        [ScanApi setDelegate:delegate];
+    }
+#endif
+
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
 {
     
@@ -2968,12 +2979,11 @@ void UncaughtExceptionHandler(NSException *exception) {
     // confirm the decoded data
     self.doAppDataConfirmation=NO;
     
+    
+#ifdef USE_MFI_SCANNER
+    
     if(ScanApi==nil){
-#ifdef USE_SOFTSCAN
-        // this is useful for SoftScan to keep a handle
-        // that is used in the trigger button
-        _softScanDeviceInfo=nil;
-#endif
+
         
         ScanApi=[[ScanApiHelper alloc]init];
         [ScanApi setDelegate:self];
@@ -2991,6 +3001,28 @@ void UncaughtExceptionHandler(NSException *exception) {
             [self enableScanner:autolaunch];
         
     }
+#else
+    if(true){
+
+        
+     
+        self.enable_ScannerLog = true;
+        self.api_Status= API_STOP;
+        
+        
+        
+        //        UIApplication * app = [UIApplication sharedApplication];
+        //        AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+        //
+        NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
+        bool  autolaunch = [defaults boolForKey:@"EnableScannerOnLaunch"] ;
+        if(autolaunch==true)
+            [self enableScanner:autolaunch];
+        
+    }
+    
+#endif
+    
     dispatch_async(dispatch_get_global_queue(0, 0), ^{
         [self handleErrorLog];
     });
@@ -3060,6 +3092,10 @@ void UncaughtExceptionHandler(NSException *exception) {
 // THE SCANNER, THESE CALLBACKS CAN BE REMOVED
 
 // callback received when the Get Symbology Status is completed
+
+
+#ifdef USE_MFI_SCANNER
+
 -(void)onGetSymbologyDpm:(ISktScanObject*)scanObj{
     [self addlog:@"onGetSymbologyDpm:"];
     
@@ -3219,19 +3255,7 @@ void UncaughtExceptionHandler(NSException *exception) {
 /**
  *
  */
-#ifdef USE_SOFTSCAN
--(void) onSetOverlayView:(ISktScanObject*)scanObj{
-    SKTRESULT result=[[scanObj Msg]Result];
-    if(SKTSUCCESS(result)){
-        [self addlog:@"Overlay view set success"];
-    }
-    else{
-        [self addlog:[NSString stringWithFormat:@"Overlay view set returned the error %ld",result]];
-        
-        
-    }
-}
-#endif
+
 /**
  * called each time a device connects to the host
  * @param result contains the result of the connection
@@ -3243,19 +3267,7 @@ void UncaughtExceptionHandler(NSException *exception) {
     [self updateDevicesList:deviceInfo Add:YES];
     
     
-#ifdef USE_SOFTSCAN
-    // if the scanner is a SoftScan scanner
-    if([deviceInfo.getTypeString compare:@"SoftScan"]==NSOrderedSame){
-        //  _softScannerTriggerBtn.hidden=NO;
-        _softScanDeviceInfo=deviceInfo;
-        if(_deviceInfoToTrigger==nil)
-            _deviceInfoToTrigger=deviceInfo;
-        NSMutableDictionary* overlayParameter=[[NSMutableDictionary alloc]init];
-        [overlayParameter setValue:self forKey:[NSString stringWithCString:kSktScanSoftScanContext encoding:NSASCIIStringEncoding]];
-        [ScanApi postSetOverlayView:deviceInfo OverlayView:overlayParameter Target:self Response:@selector(onSetOverlayView:)];
-    }
-    else
-#endif
+
     {
         if([deviceInfo.getTypeString compare:@"CHS 8Ci Scanner"]==NSOrderedSame){
             //            _softScannerTriggerBtn.hidden=NO;
@@ -3294,13 +3306,7 @@ void UncaughtExceptionHandler(NSException *exception) {
     if(_deviceInfoToTrigger==deviceRemoved){
         _deviceInfoToTrigger=nil;
     }
-#ifdef USE_SOFTSCAN
-    if(_softScanDeviceInfo==deviceRemoved){
-        _softScanDeviceInfo=nil;
-    }
-    if(_deviceInfoToTrigger==nil)
-        _deviceInfoToTrigger=_softScanDeviceInfo;
-#endif
+
     if(_deviceInfoToTrigger==nil){
         //        _softScannerTriggerBtn.hidden=YES;
     }
@@ -3410,16 +3416,10 @@ void UncaughtExceptionHandler(NSException *exception) {
         NSString* strlog =[NSString stringWithFormat:@"onScanApiInitialize SUCCESS result:%ld",result];
         [self addlog:strlog];
         
-#ifdef USE_SOFTSCAN
-        // make sure we support SoftScan
-        [ScanApi postSetSoftScanStatus:kSktScanSoftScanSupported Target:self Response:@selector(onSetSoftScanStatus:)];
-        
-        // check if SoftScan is enabled
-        [ScanApi postGetSoftScanStatus:self Response:@selector(onGetSoftScanStatus:)];
-#else
+
         // disable support SoftScan (Default, not really needed if it was never activated)
         [ScanApi postSetSoftScanStatus:kSktScanSoftScanNotSupported Target:self Response:@selector(onSetSoftScanStatus:)];
-#endif
+
         
         // ask for ScanAPI version (not a requirement but always nice to know)
         [ScanApi postGetScanApiVersion:self Response:@selector(onGetScanApiVersion:)];
@@ -3521,12 +3521,21 @@ void UncaughtExceptionHandler(NSException *exception) {
 
 }
 
+#endif
 #pragma mark - Scaner
 -(void)onTimer: (NSTimer*)theTimer{
     if(theTimer==ScanApiConsumer){
         
         //  [self addlog:@"ScanApi::doScanApiReceive:"];
+        
+        
+        
+        
+#ifdef USE_MFI_SCANNER
+        
         [ScanApi doScanApiReceive];
+#endif
+
     }
 }
 -(void) addlog:(NSString*) newtext
@@ -3563,6 +3572,11 @@ void UncaughtExceptionHandler(NSException *exception) {
 
     });
 }
+
+
+
+#ifdef USE_MFI_SCANNER
+
 - (void)enableScanner:(bool)enable {
     
     [self addlog:@"Enable scanner:"];
@@ -3673,6 +3687,7 @@ void UncaughtExceptionHandler(NSException *exception) {
     // [self.dev_table reloadData];
     
 }
+#endif
 
 #pragma mark - offline order
 -(void) backup_oc

+ 12 - 3
RedAnt ERP Mobile/common/Functions/sidemenu/ScannerSettingViewController.m

@@ -15,10 +15,10 @@
 
 @implementation ScannerSettingViewController
 {
-#ifdef USE_SOFTSCAN
-    DeviceInfo* _softScanDeviceInfo;
-#endif
+#ifdef USE_MFI_SCANNER
     DeviceInfo* _deviceInfoToTrigger;
+    
+#endif
 //    DeviceInfo* _deviceInfoToTrigger;
 //    NSDate* _lastCheck;
 //    NSInteger _sameSecondCount;
@@ -350,9 +350,18 @@
     UITableViewCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
     UIApplication * app = [UIApplication sharedApplication];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+    
+#ifdef USE_MFI_SCANNER
+    
     DeviceInfo* info = appDelegate.devices[indexPath.row];
     cell.textLabel.text = [info getName];
     cell.detailTextLabel.text = info.getTypeString;
+    
+#endif
+    
+//    DeviceInfo* info = appDelegate.devices[indexPath.row];
+//    cell.textLabel.text = [info getName];
+//    cell.detailTextLabel.text = info.getTypeString;
     return cell;
 }
 

+ 1 - 1
RedAnt ERP Mobile/iSales-CONTRAST/config.h

@@ -20,7 +20,7 @@
 #define RA_NOTIFICATION
 
 # ifdef DEBUG
-    # define test_server
+//    # define test_server
 # endif
 
 #define exception_switch 1