TwilioVerifyManager
public class TwilioVerifyManager
extension TwilioVerifyManager: TwilioVerify
Handles the available operations to proccess Factors and Challenges
-
Creates a Factor from a FactorPayload
Declaration
Swift
public func createFactor(withPayload payload: FactorPayload, success: @escaping FactorSuccessBlock, failure: @escaping TwilioVerifyErrorBlock)
Parameters
payload
Describes the information needed to create a factor
success
Closure to be called when the operation succeeds, returns the created Factor
failure
Closure to be called when the operation fails with the cause of failure
-
Verifies a Factor from a VerifyFactorPayload
Declaration
Swift
public func verifyFactor(withPayload payload: VerifyFactorPayload, success: @escaping FactorSuccessBlock, failure: @escaping TwilioVerifyErrorBlock)
Parameters
payload
Describes the information needed to verify a factor
success
Closure to be called when the operation succeeds, returns the verified Factor
failure
Closure to be called when the operation fails with the cause of failure
-
Updates a Factor from a UpdateFactorPayload
Declaration
Swift
public func updateFactor(withPayload payload: UpdateFactorPayload, success: @escaping FactorSuccessBlock, failure: @escaping TwilioVerifyErrorBlock)
Parameters
payload
Describes the information needed to update a factor
success
Closure to be called when the operation succeeds, returns the updated Factor
failure
Closure to be called when the operation fails with the cause of failure
-
Gets all Factors created by the app
Declaration
Swift
public func getAllFactors(success: @escaping FactorListSuccessBlock, failure: @escaping TwilioVerifyErrorBlock)
Parameters
success
Closure to be called when the operation succeeds, returns an array of Factors
failure
Closure to be called when the operation fails with the cause of failure
-
Deletes a Factor with the given Sid
Declaration
Swift
public func deleteFactor(withSid sid: String, success: @escaping EmptySuccessBlock, failure: @escaping TwilioVerifyErrorBlock)
Parameters
sid
Sid of the Factor to be deleted
success
Closure to be called when the operation succeeds
failure
Closure to be called when the operation fails with the cause of failure
-
Gets a Challenge with the given challenge sid and factor Sid
Declaration
Swift
public func getChallenge(challengeSid: String, factorSid: String, success: @escaping ChallengeSuccessBlock, failure: @escaping TwilioVerifyErrorBlock)
Parameters
challengeSid
Sid of the Challenge requested
factorSid
Sid of the Factor to which the Challenge corresponds
success
Closure to be called when the operation succeeds, returns the requested Challenge
failure
Closure to be called when the operation fails with the cause of failure
-
Updates a Challenge from a UpdateChallengePayload
Declaration
Swift
public func updateChallenge(withPayload payload: UpdateChallengePayload, success: @escaping EmptySuccessBlock, failure: @escaping TwilioVerifyErrorBlock)
Parameters
payload
Describes the information needed to update a challenge
success
Closure to be called when the operation succeeds
failure
Closure to be called when the operation fails with the cause of failure
-
Gets all Challenges associated to a Factor with the given ChallengeListPayload
Declaration
Swift
public func getAllChallenges(withPayload payload: ChallengeListPayload, success: @escaping (ChallengeList) -> (), failure: @escaping TwilioVerifyErrorBlock)
Parameters
payload
Describes the information needed to fetch all the Challenges
success
Closure to be called when the operation succeeds, returns a ChallengeList which contains the Challenges and the metadata associated to the request
failure
Closure to be called when the operation fails with the cause of failure
-
Clears local storage, it will delete factors and key pairs in this device.
Throws
An error, if there is an error clearing the local storage. ## Important Note ## Calling this method will not delete factors in Verify Push API, so you need to delete them from your backend to prevent invalid/deleted factors when getting factors for an identity.Declaration
Swift
public func clearLocalStorage() throws