InteractionViewController

open class InteractionViewController: UIViewController

Displays an interaction with Talkdesk. Abstracts all the workflow and knows how and when it should present content.

When instantiating this type you should pass the intention name associated to the interaction.

Usage:

let vc = InteractionViewController(intention: "customer-support")
presentViewController(vc, animated: true)
  • Defines the behaviour when the interaction finishes.

    If set to true an interaction of the same type starts when the current one finishes. If set to false the interaction management must be made by the client code.

    Declaration

    Swift

    @IBInspectable open var shouldRestartOnClose: Bool = false
  • Convenience initializer to start a given type of interaction.

    Declaration

    Swift

    convenience public init(intention: String, contextualInfo: ContextualCallback? = nil)

    Parameters

    intention

    the name of the intention to display

  • Initializes the InteractionViewController with a specific interaction channel.

    Declaration

    Swift

    required public init(channel: InteractionChannel, contextualInfo: ContextualCallback? = nil)

    Parameters

    channel

    the interaction channel associated to this ViewController

  • Initializer.

    Declaration

    Swift

    required public init?(coder aDecoder: NSCoder)
  • Sets up the InteractionViewController with the given options.

    Warning

    This method should be used just by Objective-C applications. Unpredictable results might occur if it is used from Swift code.

    Note

    Be sure to supply the "intention" key in options.

    Usage:

     NSDictionary *options = @{ @"intention" : @"callback"};
    
     NSError *error;
     InteractionViewController *vc = [InteractionViewController interactionViewControllerWithOptions:options error:&error];
     if(!error) {
       // Present view controller
     } else {
       // Treat error
     }
    

    Declaration

    Swift

    @objc open class func interactionViewControllerWithOptions(_ options: NSDictionary) throws -> Any

    Parameters

    options

    a NSDictionary with the InteractionViewController options