APIManager
Objective-C
@interface APIManager
Swift
class APIManager
A utitlity class used to perform all the different calls to ScanTrust’s backend server.
-
Shared instance for the APIManager class, initialise the APIManager class with necessary constants
Declaration
Objective-C
+ (nullable APIManager *)sharedInstance;Swift
class func sharedInstance() -> APIManager? -
To send a scan query (for unsupported phones / no-auth codes)
Declaration
Objective-C
- (void)sendScanQueryWithBasicScanCandidate:(id)scanCandidate token:(nullable NSString *)token completion: (void (^_Nullable)(int *_Nonnull, NSError *_Nullable)) completionBlock;Swift
func sendScanQuery(withBasicScanCandidate scanCandidate: Any!, token: String?) async throws -> UnsafeMutablePointer<Int32>Parameters
scanCandidatescan data for basic scan
tokenrequest authentication token
completionBlockA block object to be executed when the network request finishes successfully. This block has return values of STAuthResposne class and NSError (if any)
-
To send a scan query (for unsupported phones / no-auth codes)
Declaration
Objective-C
- (void)sendScanQueryWithBasicScanCandidate:(id)scanCandidate completion: (void (^_Nullable)(int *_Nonnull, NSError *_Nullable)) completionBlock;Swift
func sendScanQuery(withBasicScanCandidate scanCandidate: Any!) async throws -> UnsafeMutablePointer<Int32>Parameters
scanCandidatescan data for basic scan
completionBlockA block object to be executed when the network request finishes successfully. This block has return values of STAuthResposne class and NSError (if any)
-
To Authenticate a scan
Declaration
Objective-C
- (void)authenticateAuthenticationRequestData: (nonnull SerializableAuthenticationRequestData *)requestData withAuthToken:(nullable NSString *)token completion: (void (^_Nullable)(int *_Nonnull, NSError *_Nullable)) completionBlock;Swift
func authenticateAuthenticationRequestData(_ requestData: SerializableAuthenticationRequestData, withAuthToken token: String?) async throws -> UnsafeMutablePointer<Int32>Parameters
requestDataauthentication data
tokenrequest authentication token
completionBlockA block object to be executed when the network request finishes successfully. This block has return values of STAuthResposne class and NSError (if any)
-
To rget authentication details for a given code ID
Declaration
Objective-C
- (void)requestAuthenticationDetailsForCode:(nonnull NSString *)codeId onHost:(nonnull NSString *)host codeSpace:(nonnull NSString *)codeSpace by:(nonnull id)requester;Swift
func requestAuthenticationDetails(forCode codeId: String, onHost host: String, codeSpace: String, by requester: Any)Parameters
codeIdid string for the code
hosthost name for a code
codeSpacea code space string
requesteran object which confirms to
CodeAuthenticationDetailsReceiverProtocol
APIManager Class Reference