SINVerification Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | SINVerification.h |
– initiateWithCompletionHandler:
required method
Initiate the verification.
- (void)initiateWithCompletionHandler:(void ( ^ ) ( id<SINInitiationResult> result , NSError *__nullable error ))completionHandler
Parameters
completionHandler |
Block that will be invoked upon successful initiation. |
---|
Discussion
A request will be sent to the Sinch backend, which in case of SMS-based verification, will initiate sending an SMS to the destination phone number.
Declared In
SINVerification.h
– verifyCode:completionHandler:
required method
Complete the verification by verifying the verification code sent to the user.
- (void)verifyCode:(NSString *)code completionHandler:(void ( ^ ) ( BOOL success , NSError *__nullable error ))completionHandler
Parameters
code |
Verification code that the user received and have given as input to the application. |
---|---|
completionHandler |
Block that will be invoked upon successful initiation. |
Declared In
SINVerification.h
– cancel
required method
Cancel the verification (client-side only).
- (void)cancel
Discussion
Note that cancelling is a client-side only action, i.e. it will not send any further requests to the Sinch platform and it does not guarantee that a SMS or a callout won’t be made to the user’s device. What it will do is cancel any long-polling requests that this verification instance may be maintaining (e.g. a callout verification is performing polling to query the Sinch platform for the status of the verification)
If the verification is in a state where a completion handler have been specified, the handler will be invoked with the error code SINVerificationErrorCancelled.
Declared In
SINVerification.h
– setEnvironmentHost:
required method
Specify a specific Sinch environment host. (This is not mandatory) This must be set before initiateWithCompletionHandler: or verifyCode:completionHandler: is called.
- (void)setEnvironmentHost:(NSString *)environmentHost
Parameters
environmentHost |
Host for base URL for the Sinch API environment to be used. E.g. ‘sandbox.sinch.com’ |
---|
Declared In
SINVerification.h
– setCompletionQueue:
required method
Specify a dispatch queue on which completionHandler
blocks of a SINVerification
should be invoked on. Unless specified, the main queue is used by default.
This must be set before initiateWithCompletionHandler: or verifyCode:completionHandler: is called.
- (void)setCompletionQueue:(dispatch_queue_t)completionQueue
Parameters
completionQueue |
GCD dispatch queue |
---|
Declared In
SINVerification.h