ASAPPChannelDelegate

@objc
public protocol ASAPPChannelDelegate

Defines methods that may be called by a ASAPPChatInsteadViewController instance.

  • Called every time the user selects a channel to open. Return false if you want to handle the action yourself. Otherwise, the SDK will handle the action automatically. Returns true by default. Note that this doesn’t include the chat channel, as it must be handled by didSelectASAPPChatChannel().

    Declaration

    Swift

    @objc
    optional func shouldOpenChannel(_ channel: ASAPPChannel) -> Bool

    Parameters

    channel

    The enum indicating which channel was selected.

  • Called if there was an error when attempting to open a channel.

    Declaration

    Swift

    func channel(_ channel: ASAPPChannel, didFailToOpenWithErrorDescription errorDescription: String?)

    Parameters

    channel

    An enum case indicating which channel failed to open.

    errorDescription

    A String with information about the error.

  • Called if the ASAPP chat channel is selected. The implementation must use either createChatViewControllerForPresentingFromChatInstead or createChatViewControllerForPushingFromChatInstead to open chat.

    Declaration

    Swift

    func didSelectASAPPChatChannel()