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.
-
Unique identifier for the message. Maps to
messageIdfrom 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
ModuleNamefor possible values.Declaration
Swift
var source: String? { get }
-
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).valueis 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 Stringkeyare 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.
nilwhen the message has none. Track a tap withInboxMessageInteraction(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 }
-
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
truewhen the server payload omits the flag.Declaration
Swift
var countInBadge: Bool { get }
-
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 }
InboxMessage Protocol Reference