InboxMessage

@objc(SFMCSdkInboxMessage)
public protocol InboxMessage

Public protocol representing an inbox message from the Marketing Cloud. Consumers receive instances of this protocol via InboxFeature methods. Every property is read-only: an inbox message is an immutable snapshot of what the SDK received. Optional properties are nil when the backend did not supply a value.

Identifiers

  • Unique identifier for the message. Maps to messageId from the server payload.

    Declaration

    Swift

    var messageId: String { get }
  • The kind of inbox message.

    Declaration

    Swift

    var messageType: InboxMessageType { get }
  • The SDK module that originated this inbox message. See ModuleName for possible values.

    Declaration

    Swift

    var source: String? { get }
  • Audience string. Known values: device, user. Unknown values are surfaced as-is. Missing or empty is device.

    Declaration

    Swift

    var audienceType: String { get }

Content

  • Subject line of the inbox message. Displayed as the primary title in inbox list views.

    Declaration

    Swift

    var subject: InboxText? { get }
  • Display subtitle of the message.

    Declaration

    Swift

    var subtitle: InboxText? { get }
  • Body text of the inbox message.

    Declaration

    Swift

    var message: InboxText? { get }
  • Message-level call to action. Track a tap with InboxMessageInteraction(type: .cta, id: nil). value is the clicked text.

    Declaration

    Swift

    var action: InboxAction { get }
  • Custom string payload attached to the message.

    Declaration

    Swift

    var custom: String? { get }
  • Custom key/value pairs attached to the message, flattened into a single dictionary. The backend delivers these as an array of {key, value} objects; the inbox module flattens them at parse time so consumers receive a straightforward [String: Any]. On duplicate keys the last pair wins; pairs missing a String key are dropped.

    Declaration

    Swift

    var customKeys: [String : Any]? { get }
  • Sound identifier associated with the message.

    Declaration

    Swift

    var sound: String? { get }
  • Message’s media asset, if any.

    Declaration

    Swift

    var media: InboxMedia? { get }
  • Buttons on this message, in payload order. nil when the message has none. Track a tap with InboxMessageInteraction(type: .button, id: button.id).

    Declaration

    Swift

    var buttons: [InboxButton]? { get }
  • Raw notification payload backing the message, if delivered via push.

    Declaration

    Swift

    var notificationMessage: [String : Any]? { get }

Status

  • Whether the message has been read.

    Declaration

    Swift

    var read: Bool { get }
  • Whether the message has been deleted.

    Declaration

    Swift

    var deleted: Bool { get }
  • Whether this message contributes to the unread-count badge. Defaults to true when the server payload omits the flag.

    Declaration

    Swift

    var countInBadge: Bool { get }

Dates

  • Start date (UTC) when the message becomes valid. Messages before this date are filtered out.

    Declaration

    Swift

    var startDate: Date? { get }
  • End date (UTC) when the message expires. Messages past this date are filtered out.

    Declaration

    Swift

    var endDate: Date? { get }
  • Date (UTC) when the message was sent from the Marketing Cloud server.

    Declaration

    Swift

    var sendDate: Date? { get }