MessageCenterInboxProtocol

public protocol MessageCenterInboxProtocol : AnyObject, Sendable

Airship Message Center inbox protocol.

  • refreshMessages() Asynchronous

    Refreshes the list of messages in the inbox.

    Declaration

    Swift

    @discardableResult
    func refreshMessages() async -> Bool

    Return Value

    true if the messages was refreshed, otherwise false.

  • markRead(messages:) Asynchronous

    Marks messages read.

    Declaration

    Swift

    func markRead(messages: [MessageCenterMessage]) async

    Parameters

    messages

    The list of messages to be marked read.

  • markRead(messageIDs:) Asynchronous

    Marks messages read by message IDs.

    Declaration

    Swift

    func markRead(messageIDs: [String]) async

    Parameters

    messageIDs

    The list of message IDs for the messages to be marked read.

  • delete(messages:) Asynchronous

    Marks messages deleted.

    Declaration

    Swift

    func delete(messages: [MessageCenterMessage]) async

    Parameters

    messages

    The list of messages to be marked deleted.

  • delete(messageIDs:) Asynchronous

    Marks messages deleted by message IDs.

    Declaration

    Swift

    func delete(messageIDs: [String]) async

    Parameters

    messageIDs

    The list of message IDs for the messages to be marked deleted.

  • message(forBodyURL:) Asynchronous

    Returns the message associated with a particular URL.

    Declaration

    Swift

    func message(forBodyURL bodyURL: URL) async -> MessageCenterMessage?

    Parameters

    bodyURL

    The URL of the message.

    Return Value

    The associated MessageCenterMessage object or nil if a message was unable to be found.

  • message(forID:) Asynchronous

    Returns the message associated with a particular ID.

    Declaration

    Swift

    func message(forID messageID: String) async -> MessageCenterMessage?

    Parameters

    messageID

    The message ID.

    Return Value

    The associated MessageCenterMessage object or nil if a message was unable to be found.

  • Publisher that emits messages.

    Declaration

    Swift

    @MainActor
    var messagePublisher: AnyPublisher<[MessageCenterMessage], Never> { get }
  • Async Stream on messages’ updates

    Declaration

    Swift

    var messageUpdates: AsyncStream<[MessageCenterMessage]> { get }
  • Publisher that emits unread counts.

    Declaration

    Swift

    @MainActor
    var unreadCountPublisher: AnyPublisher<Int, Never> { get }
  • Async Stream of unread count updates

    Declaration

    Swift

    var unreadCountUpdates: AsyncStream<Int> { get }
  • messages Asynchronous

    The list of messages in the inbox.

    Declaration

    Swift

    var messages: [MessageCenterMessage] { get async }
  • user Asynchronous

    The user associated to the Message Center

    Declaration

    Swift

    var user: MessageCenterUser? { get async }
  • unreadCount Asynchronous

    The number of messages that are currently unread.

    Declaration

    Swift

    var unreadCount: Int { get async }
  • Refreshes the list of messages in the inbox.

    Declaration

    Swift

    @discardableResult
    func refreshMessages(timeout: TimeInterval) async throws -> Bool

    Return Value

    true if the messages was refreshed, otherwise false.