VoiceChallenge

public final class VoiceChallenge : NSObject, ChallengeProtocol, AVAudioRecorderDelegate

The voice biometric challenge prompts the user to verify a phrase. The challenge will record for 10 seconds unless stop is explicily invoked.

Warning

Tech-preview not to be used in your code.
  • Initializes a new VoiceChallenge mechanism.

    Declaration

    Swift

    required public convenience override init()
  • Initializes a new VoiceChallenge mechanism.

    Declaration

    Swift

    required public init(messagePrompt: String)

    Parameters

    messagePrompt

    The message to display in the alert when prompted.

  • The name of the mechanism.

    Declaration

    Swift

    open var name: String { get }
  • The description of the mechanism.

    Declaration

    Swift

    open override var description: String { get }
  • The identifier of the mechanism.

    Remark

    The identifier value is: urn:ibm:security:authentication:asf:mechanism:mobile_user_approval:voice.

    Declaration

    Swift

    open var identifier: String { get }
  • The postback URI of the mechanism.

    Remark

    This value is set in the parse method.

    Declaration

    Swift

    open var postbackUri: String
  • The enrolled voice template.

    Remark

    This value is passed in the completionHandler in launchUI method.

    Declaration

    Swift

    open var template: String
  • The state represents the unique identifier of the machanism request.

    Remark

    This value is set in the parse method.

    Declaration

    Swift

    open var state: String
  • The message to display in the alert when prompted.

    Remark

    This value can be asigned in the constructor or during parse method.

    Declaration

    Swift

    open var messagePrompt: String
  • An array of String representing names of key handles.

    Declaration

    Swift

    open fileprivate(set) var keyHandles: [String]
  • The text representing the server challenge which requires signing.

    Declaration

    Swift

    open fileprivate(set) var challengeText: String
  • The voice sample recorded.

    Declaration

    Swift

    open fileprivate(set) var sampleData: String
  • The dictionary represeting the data that will be returned in the VoiceChallenge.launchUI function.

    Remark

    The default is to return the challenge unsigned.

    Declaration

    Swift

    open var challengeData: [String : Any]
  • The type of the enrollment challenge.

    Declaration

    Swift

    open var type: String { get }
  • The type’s identifier, used to access the private key in the keychain. Only one challenge of this type can be enrolled, so there’s no overlap.

    Declaration

    Swift

    open var keyName: String
  • Initializes a new challenge mechanism.

    Throws

    IBMMobileKitError.invalidDataFromServer

    Declaration

    Swift

    public func parse(_ data: [String : Any]) throws -> VoiceChallenge

    Parameters

    data

    A data object containing JSON data.

    Return Value

    The instance of VoiceChallenge.

  • This method launches an UIAlertController thats prompts prompts the user for voice confirmation.

    Warning

    Tech-preview not to be used in your code.

    Declaration

    Swift

    open func launchUI(_ viewController: UIViewController, completion: @escaping (_ data: [String:Any], _ error: Error?) -> Void)

    Parameters

    viewController

    The view controller that is presented by this view controller, or one of its ancestors in the view controller hierarchy.

    completion

    The data to verify represented as an dictionary of String:Any and Error object to identify an error.

  • This method launches an UIAlertController thats prompts prompts the user for presence confirmation.

    Warning

    Tech-preview not to be used in your code.

    Declaration

    Swift

    open func launchUI(_ completion: @escaping (_ data: [String:Any], _ error: Error?) -> Void)

    Parameters

    completion

    The data to verify represented as an dictionary of String:String? and Error object to identify an error.

  • Callback to handle the completed recording session.

    Declaration

    Swift

    public func audioRecorderDidFinishRecording(_ recorder: AVAudioRecorder, successfully flag: Bool)