ScanEngine
Objective-C
@interface ScanEngine : NSObject
Swift
class ScanEngine : NSObject
The entry point of the Scantrust Processing is the ScanEngine, this class does all the heavy lifting, setting up the camera and the preview (view finder) view, running the image processing on the incoming frames and reporting the various outcomes.
-
Configuration class to modify setting for the ScanEngine
Declaration
Objective-C
@property (strong, readonly) Configuration* configuration
-
A protocol to receive updates on the scan engine feedbacks
Declaration
Objective-C
@property (strong, readonly) id _Nonnull feedbackReceiver;
Swift
var feedbackReceiver: Any { get }
-
A subclass of UIView to represent the camera preview and extendes from UIView Which hold the preview layer to customize and view the camera frames
Declaration
Objective-C
@property (weak, nonatomic) PreviewView* previewView
-
A protocol to receive messages from ScanEngine
Declaration
Objective-C
@property (nonatomic, weak) id<ScanEngineMessageReceiver> _Nullable messageReceiver;
Swift
weak var messageReceiver: ScanEngineMessageReceiver? { get set }
-
To intialise the ScanEngine Object
Declaration
Objective-C
- (nonnull instancetype)initWithEndSesionDelegate:(nonnull id)endSessionDelegate feedbackReceiver:(nonnull id)feedbackReceiver authenticationDetailsProvider: (nonnull id)authenticationDetailsProvider;
Swift
init(endSesionDelegate endSessionDelegate: Any, feedbackReceiver: Any, authenticationDetailsProvider: Any)
Parameters
endSessionDelegate
an object confirms to
AuthenticationSessionEndedDelegateProtocol
feedbackReceiver
an object confirms to
ScanEngineFeedbackReceiverProtocol
authenticationDetailsProvider
an object confirms to
CodeAuthenticationDetailsProviderProtocol
-
To intialise the ScanEngine Object
Declaration
Objective-C
- (nonnull instancetype)initWithEndSesionDelegate:(nonnull id)endSessionDelegate feedbackReceiver:(nonnull id)feedbackReceiver;
Swift
init(endSesionDelegate endSessionDelegate: Any, feedbackReceiver: Any)
Parameters
endSessionDelegate
an object confirms to
AuthenticationSessionEndedDelegateProtocol
feedbackReceiver
an object confirms to
ScanEngineFeedbackReceiverProtocol
-
To start the scanner and frame processing
Declaration
Objective-C
- (void)start;
Swift
func start()
-
To stop the scanner and frame processing
Declaration
Objective-C
- (void)stop;
Swift
func stop()
-
To reset the scanner and frame processing
Declaration
Objective-C
- (void)reset;
Swift
func reset()
-
To release the scanner and its camera
Declaration
Objective-C
- (void)release_;
Swift
func release_()
-
To analyse the scanned code content
Declaration
Objective-C
- (id)analyseContent:(nonnull NSString *)content;
Swift
func analyseContent(_ content: String) -> Any!
Parameters
content
a parsed content with details
-
Declaration
Objective-C
- (ScanEngineStartSessionResponse)startAuthenticationSession:(id)content;
Swift
func startAuthenticationSession(_ content: Any!) -> ScanEngineStartSessionResponse
-
Declaration
Objective-C
- (ScanEngineStartSessionResponse)startAuthenticationSessionWithRawContent: (nonnull NSString *)content;
Swift
func startAuthenticationSession(withRawContent content: String) -> ScanEngineStartSessionResponse
-
To stop the authentication session.
Note
Typically used to run camera but stop the frame processing.
Declaration
Objective-C
- (ScanEngineStopSessionResponse)stopAuthenticationSession;
Swift
func stopAuthenticationSession() -> ScanEngineStopSessionResponse
-
Declaration
Objective-C
- (ScanEngineAnalyseImageResponse)pushImageForAnalyse: (nonnull CMSampleBufferRef)image;
Swift
func pushImage(forAnalyse image: CMSampleBuffer) -> ScanEngineAnalyseImageResponse
-
To control the status of the flash light
Declaration
Objective-C
- (BOOL)turnTorchOnOff:(BOOL)onOff;
Swift
func turnTorch(onOff: Bool) -> Bool
Parameters
onOff
a boolean to control the flash light turning on or off
-
To know whether the current device is supported for authentication or not
Declaration
Objective-C
+ (BOOL)isDeviceSupported;
Swift
class func isDeviceSupported() -> Bool
-
To preload configurations for ScanEngine
Declaration
Objective-C
+ (void)preloadConfiguration:(nonnull id<ScanEngineMessageReceiver>)delegate;
Swift
class func preloadConfiguration(_ delegate: ScanEngineMessageReceiver)