HSBeaconContactForm

Objective-C

@interface HSBeaconContactForm : NSObject

Swift

class HSBeaconContactForm : NSObject

A model object representing a new conversation. Values set on this are prepopulated in the new conversation contact form.

  • Unavailable

    init not available

    The HSBeaconContactForm initializer is not publicly available. Beacon SDK will create the form and pass it via delegate methods when required.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • The ID of the Beacon that’s being prefilled. Useful if you have multiple Beacons in your app and need different prefill logic for each one.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *_Nonnull beaconID;

    Swift

    var beaconID: String { get }
  • The customer email. This will be ignored if secure mode is used or if the customer has previously sent a message through the Beacon SDK. Unlike the email set in the login method, this value will be editable for the customer.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSString *_Nonnull email;

    Swift

    var email: String { get set }
  • The customer name. This will be ignored if the user has previously sent a message through the Beacon SDK. Unlike the name set in the login method, this value will be editable for the customer.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSString *name;

    Swift

    var name: String? { get set }
  • The message subject

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSString *subject;

    Swift

    var subject: String? { get set }
  • The body text for the email.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSString *text;

    Swift

    var text: String? { get set }
  • Read only dictionary of the custom fields ids and values set on this object

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSDictionary<NSNumber *, NSString *> *_Nonnull customFields;

    Swift

    var customFields: [NSNumber : String] { get }
  • Read only array of the files attached to this object.

    Declaration

    Objective-C

    @property (readonly) NSArray<id<HSBeaconContactFormAttachment>> *_Nonnull attachments;

    Swift

    var attachments: [HSBeaconContactFormAttachment] { get }
  • Adds a new attachment to this object. There is a maximum of 3 attachments allowed. Any calls after the first 3 will be ignored and the method will return NO.

    Declaration

    Objective-C

    - (BOOL)addAttachment:(nonnull NSString *)filename data:(nonnull NSData *)data;

    Swift

    func addAttachment(_ filename: String, data: Data) -> Bool
  • Adds a prefilled custom field value to the form.

    For dropdown fields, set this to the id of the value you want to select.

    For date fields, use yyyy-MM-dd style.

    Declaration

    Objective-C

    - (void)addCustomFieldValue:(nonnull NSString *)value forId:(int)fieldId;

    Swift

    func addCustomFieldValue(_ value: String, forId fieldId: Int32)