Skip to content

Urgency #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Sources/WebPush/WebPushManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,30 @@ extension WebPushManager {
}

extension WebPushManager {
/// The urgency with which to deliver a push message.
///
/// - SeeAlso: [RFC 8030 Generic Event Delivery Using HTTP §5.3. Push Message Urgency](https://datatracker.ietf.org/doc/html/rfc8030#section-5.3)
public struct Urgency: Hashable, Comparable, Sendable, CustomStringConvertible {
let rawValue: String

/// An urgency intended only for devices on power and Wi-Fi.
///
/// For instance, very low ugency messages are ideal for advertisements.
public static let veryLow = Self(rawValue: "very-low")

/// An urgency intended for devices on either power or Wi-Fi.
///
/// For instance, low ugency messages are ideal for topic updates.
public static let low = Self(rawValue: "low")

/// An urgency intended for devices on neither power nor Wi-Fi.
///
/// For instance, normal ugency messages are ideal for chat or calendar messages.
public static let normal = Self(rawValue: "normal")

/// An urgency intended for devices even with low battery.
///
/// For instance, high ugency messages are ideal for incoming phone calls or time-sensitive alerts.
public static let high = Self(rawValue: "high")

@usableFromInline
Expand Down
Loading