InactivityPopup
public struct InactivityPopup : Equatable, Sendable
Represents the structured data required to display and manage an inactivity popup within a chat session.
The InactivityPopup encapsulates all information needed to present a user-facing popup when inactivity is detected.
It includes the popup’s title, message body, countdown timer, and associated action buttons for refreshing or expiring the session.
This struct is typically used to prompt the user to take action before their session expires due to inactivity.
Note
The countdown is managed usingnumberOfSeconds and startedAt, allowing calculation of the remaining time.
-
The title of the popup.
Declaration
Swift
public let title: String -
The message body of the popup.
It’s a combination of body text and the call to action text from the configuration.
Declaration
Swift
public let message: String -
The countdown duration in seconds.
This is the total time for the countdown. The actual remaining time can be calculated by subtracting the elapsed time since
startedAtfrom this value.Declaration
Swift
public let numberOfSeconds: Int -
The ISO8601 date when the countdown started.
Declaration
Swift
public let startedAt: Date -
The thread ID associated with the popup.
Declaration
Swift
public let threadId: String -
The button to refresh the session.
Declaration
Swift
public let refreshButton: InactivityPopupButton -
The button to expire the session.
Declaration
Swift
public let expireButton: InactivityPopupButton
View on GitHub