HSBeaconDelegate

Objective-C

@protocol HSBeaconDelegate <NSObject>

Swift

protocol HSBeaconDelegate : NSObjectProtocol

HSBeaconDelegate can optionally be set on your HSBeaconSettings object to customize the runtime behavior of the Beacon SDK.

  • The prefill method is called before showing the new conversation contact form. Any values set on the form object will be prepopulated for the customer.

    Note

    Prefilled forms will be ignored if there is an existing draft message. Draft messages can be removed by calling the reset function on HSBeacon.

    Declaration

    Objective-C

    - (void)prefill:(nonnull HSBeaconContactForm *)form;

    Swift

    optional func prefill(_ form: HSBeaconContactForm)
  • The sessionAttributes method is called before showing the new conversation contact form. Keys (labels) and values in this dictionary (up to 20) will be added into the Beacon visitor activity note that’s only relevant to a specific conversation. We do not sync this data to either the customer profile or the Beacon Sidebar app.

    Note

    Each attribute label can contain up to 100 characters, and each value can contain up to 10,000 characters.

    Declaration

    Objective-C

    - (nonnull NSDictionary<NSString *, NSString *> *)sessionAttributes;

    Swift

    optional func sessionAttributes() -> [String : String]
  • This method is called the first time the Beacon is displayed, after the configuration has been successfully loaded over the network.

    Declaration

    Objective-C

    - (void)onBeaconInitialOpen:(nonnull HSBeaconSettings *)beaconSettings;

    Swift

    optional func onBeaconInitialOpen(_ beaconSettings: HSBeaconSettings)
  • This method is called anytime the Beacon modal is displayed.

    Declaration

    Objective-C

    - (void)onBeaconOpen:(nonnull HSBeaconSettings *)beaconSettings;

    Swift

    optional func onBeaconOpen(_ beaconSettings: HSBeaconSettings)
  • This method is called the first time the Beacon is dismissed each session.

    Declaration

    Objective-C

    - (void)onBeaconInitialClose:(nonnull HSBeaconSettings *)beaconSettings;

    Swift

    optional func onBeaconInitialClose(_ beaconSettings: HSBeaconSettings)
  • This method is called every time the Beacon modal is dismissed.

    Declaration

    Objective-C

    - (void)onBeaconClose:(nonnull HSBeaconSettings *)beaconSettings;

    Swift

    optional func onBeaconClose(_ beaconSettings: HSBeaconSettings)