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
payloadDescribes the information needed to create a factor
successClosure to be called when the operation succeeds, returns the created Factor
failureClosure 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
payloadDescribes the information needed to verify a factor
successClosure to be called when the operation succeeds, returns the verified Factor
failureClosure 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
payloadDescribes the information needed to update a factor
successClosure to be called when the operation succeeds, returns the updated Factor
failureClosure 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
successClosure to be called when the operation succeeds, returns an array of Factors
failureClosure 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
sidSid of the Factor to be deleted
successClosure to be called when the operation succeeds
failureClosure 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
challengeSidSid of the Challenge requested
factorSidSid of the Factor to which the Challenge corresponds
successClosure to be called when the operation succeeds, returns the requested Challenge
failureClosure 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
payloadDescribes the information needed to update a challenge
successClosure to be called when the operation succeeds
failureClosure 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
payloadDescribes the information needed to fetch all the Challenges
successClosure to be called when the operation succeeds, returns a ChallengeList which contains the Challenges and the metadata associated to the request
failureClosure 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
TwilioVerifyManager Class Reference