Protocols

The following protocols are available globally.

  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol AWSLexMicrophoneDelegate <NSObject>
    
    @optional
    /*
     * Send to delegate when the microphone has started recording.
     */
    - (void)interactionKitOnRecordingStart:(AWSLexInteractionKit *)interactionKit;
    
    /*
     * Sent to delegate when the microphone recording ends.
     */
    - (void)interactionKitOnRecordingEnd:(AWSLexInteractionKit *)interactionKit audioStream:(NSData *)audioStream contentType:(NSString *)contentType;
    
    /*
     * Sent to delegate when the micorphone is ready for recording.
     */
    - (void)interactionKitReadyForRecording:(AWSLexInteractionKit *)interactionKit;
    
    /*
     * Sent to delegate when the micorphone audio input sound level changes.
     */
    - (void)interactionKit:(AWSLexInteractionKit *)interactionKit onSoundLevelChanged:(double )soundLevel;
    
    @end

    Swift

    protocol AWSLexMicrophoneDelegate : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol AWSLexInteractionDelegate <NSObject>
    
    @required
    
    /*
     * Sent to delegate when an error occured from service.
     */
    - (void)interactionKit:(AWSLexInteractionKit *)interactionKit
                   onError:(NSError *)error;
    
    @optional
    
    /*
     * Sent to delegate when the all the required slots are filled, and the the fullfillment is client side.
     */
    - (void)interactionKit:(AWSLexInteractionKit *)interactionKit onDialogReadyForFulfillmentForIntent:(NSString *)intentName slots:(NSDictionary *)slots;
    
    /*
     * Sent to delegate incase you want to switch modes between text and voice input.
     */
    - (void)interactionKit:(AWSLexInteractionKit *)interactionKit
           switchModeInput:(AWSLexSwitchModeInput *)switchModeInput
          completionSource:(AWSTaskCompletionSource<AWSLexSwitchModeResponse *> * _Nullable)completionSource;
    
    /*
     * Sent to delegate when the Switch mode requires a user to input a text. You should set the completion source result to the string that you get from the user. This ensures that the session attribute information is carried over from the previous request to the next one.
     */
    - (void)interactionKitContinueWithText:(AWSLexInteractionKit *)interactionKit
                          completionSource:(AWSTaskCompletionSource<NSString *> *)completionSource;
    
    @end

    Swift

    protocol AWSLexInteractionDelegate : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol AWSLexAudioPlayerDelegate <NSObject>
    
    @optional
    
    /*
     * Sent to delegate when the Audio playback starts.
     */
    - (void)interactionKitOnAudioPlaybackStarted:(AWSLexInteractionKit *)interactionKit;
    
    /*
     * Sent to delegate when the Audio playback finished.
     */
    - (void)interactionKitOnAudioPlaybackFinished:(AWSLexInteractionKit *)interactionKit;
    
    @end

    Swift

    protocol AWSLexAudioPlayerDelegate : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol AWSLexVoiceButtonDelegate <NSObject>
    
    @required
    /*
     * On error response.
     */
    - (void)voiceButton:(AWSLexVoiceButton *)button onError:(NSError *)error;
    
    @optional
    
    /*
     * Response per service call.
     */
    - (void)voiceButton:(AWSLexVoiceButton *)button onResponse:(AWSLexVoiceButtonResponse *)response;
    
    /*
     * If the dialog fullfillment is on the client side, this method would be invoked with the filled slots.
     */
    - (void)voiceButtononReadyToFullFill:(AWSLexVoiceButton *)button withSlots:(NSDictionary *)slots;
    
    @end

    Swift

    protocol AWSLexVoiceButtonDelegate : NSObjectProtocol