SocketNotificationData
struct SocketNotificationData : Content
Informs Notification WebSocket clients of a new notification.
Each notification is delivered as a JSON string, containing a type of announcement and a string appropriate for displaying to the user. The string will be of the form, “User @authorName wrote a forum post that mentioned you.”
-
Declaration
Swift
enum NotificationTypeData : Content, CaseIterable, Equatable -
The type of event that happened. See
SocketNotificationData.NotificationTypeDatafor values.Declaration
Swift
var type: NotificationTypeData -
A string describing what happened, suitable for adding to a notification alert.
Declaration
Swift
var info: String -
An ID of an Announcement, Fez, Twarrt, ForumPost, or Event.
Declaration
Swift
var contentID: String -
An ID of a related parent object, when one exists. For
.forumMention,.moderatorForumMention,.twitarrTeamForumMention, and.alertwordPostthis is the ID of the Forum containing the post. Nil for all other types.Declaration
Swift
var secondaryContentID: String? -
Matches the
idof theNotificationrow this event was logged under (seeGET /api/v3/notification/log). Lets clients de-dupe a live push against a later fetch of the notification log. Nil for phone call signaling messages, which aren’t logged.Declaration
Swift
var notificationID: UUID? -
For .incomingPhoneCall notifications, the caller.
Declaration
Swift
var caller: UserHeader? -
For .incomingPhoneCall notification,s the caller’s IP addresses. May be nil, in which case the receiver opens a server socket instead.
Declaration
Swift
var callerAddress: PhoneSocketServerAddress? -
Declaration
Swift
init(_ type: NotificationType, info: String, id: String, notificationID: UUID? = nil) -
Declaration
Swift
init(callID: UUID, caller: UserHeader, callerAddr: PhoneSocketServerAddress?) -
Declaration
Swift
init(forCallEnded: UUID) -
Declaration
Swift
init(forCallAnswered: UUID)
View on GitHub