SCSChatBotMenu

@interface SCSChatBotMenu : NSObject

Class that manages the chatbot menu. Use this class to get information related to a chatbot menu (SCSChatBotMenu.title, SCSChatBotMenu.options, SCSChatBotMenu.type), to subscribe to the chatbot menu delegate (-addDelegate:), and to send chatbot selections (-makeSelectionAtIndex:) back to the org.

  • Array of chatbot menu options.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSArray<NSString *> *options;

    Swift

    var options: [String]! { get }
  • Chatbot menu title.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) NSString *title;

    Swift

    var title: String! { get }
  • Chatbot menu type.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) SCSChatBotMenuType type;

    Swift

    var type: SCSChatBotMenuType! { get }
  • Determines if the menu is still active. This property returns false after the menu receives a message that it is expired.

    Declaration

    Objective-C

    @property (readonly, getter=isActive, assign, nonatomic) BOOL active;

    Swift

    var isActive: Bool { get }
  • Makes a selection at a specific index.

    Declaration

    Objective-C

    - (BOOL)makeSelectionAtIndex:(NSUInteger)index;

    Swift

    func makeSelection(at index: UInt) -> Bool

    Parameters

    index

    The index corresponding to the desired menu item.

    Return Value

    Indicates whether the selection was sent. Returns false if the menu is expired.

  • Adds an instance of an id implementing the SCSChatBotMenuDelegate protocol to the list of delegates to notify.

    Declaration

    Objective-C

    - (void)addDelegate:(id<SCSChatBotMenuDelegate>)delegate;

    Parameters

    delegate

    id instance to add.

  • Adds an instance of an id implementing the SCSChatBotMenuDelegate protocol to the list of delegates to notify.

    Declaration

    Objective-C

    - (void)addDelegate:(id<SCSChatBotMenuDelegate>)delegate
                  queue:(dispatch_queue_t)queue;

    Parameters

    delegate

    id instance to add.

    queue

    dispatch_queue_t you wish your events to be called back on.

  • Removes the specified delegate from receiving events in the future.

    Note

    Once the menu receives a message that it is expired. All delegates are removed automatically.

    Declaration

    Objective-C

    - (void)removeDelegate:(id<SCSChatBotMenuDelegate>)delegate;

    Parameters

    delegate

    The SCSChatBotMenuDelegate to be removed.