Skip to content

Commit 39320ec

Browse files
Added documentation for Urgency
1 parent 534125b commit 39320ec

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Sources/WebPush/WebPushManager.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,12 +515,30 @@ extension WebPushManager {
515515
}
516516

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

524+
/// An urgency intended only for devices on power and Wi-Fi.
525+
///
526+
/// For instance, very low ugency messages are ideal for advertisements.
521527
public static let veryLow = Self(rawValue: "very-low")
528+
529+
/// An urgency intended for devices on either power or Wi-Fi.
530+
///
531+
/// For instance, low ugency messages are ideal for topic updates.
522532
public static let low = Self(rawValue: "low")
533+
534+
/// An urgency intended for devices on neither power nor Wi-Fi.
535+
///
536+
/// For instance, normal ugency messages are ideal for chat or calendar messages.
523537
public static let normal = Self(rawValue: "normal")
538+
539+
/// An urgency intended for devices even with low battery.
540+
///
541+
/// For instance, high ugency messages are ideal for incoming phone calls or time-sensitive alerts.
524542
public static let high = Self(rawValue: "high")
525543

526544
@usableFromInline

0 commit comments

Comments
 (0)