Direction
The language direction for the notification’s title, body, action titles, and order of actions.
enum Direction
The language direction for the notification’s title, body, action titles, and order of actions.
enum Direction
import WebPush
struct NotificationOptions
Additional options and configuration to use when presenting a notification.
enum PushMessage
Common Push Message types.
case auto
Use the browser’s language defaults.
case leftToRight
The notification should be presented left-to-right.
case rightToLeft
The notification should be presented right-to-left.
init(direction: Direction = .auto, language: String? = nil, tag: String? = nil, icon: URL? = nil, badgeIcon: URL? = nil, vibrate: [Int] = [], shouldRenotify: Bool = false, isSilent: Bool = false, requiresInteraction: Bool = false)
Initialize notification options.
var badgeIcon: URL?
The badge icon image to represent the notification when there is not enough space to display the notification itself such as for example, the Android Notification Bar.
var direction: Direction
The language direction for the notification’s title, body, action titles, and order of actions.
var icon: URL?
The icon to be displayed alongside the notification.
var isSilent: Bool
A preference indicating if the notification should be presented without sounds or vibrations.
var language: String?
The notification’s language.
var requiresInteraction: Bool
For devices with sufficiently large screens (ie. a laptop or desktop), a preference indicating if the notification should stay on screen until the user interacts with it rather than dismiss automatically.
var shouldRenotify: Bool
A preference indicating if the user should be alerted again after the initial notification was presented when another notification with the same tag
is sent.
var tag: String?
A tag to use to de-duplicate or replace notifications before they are presented to the user.
var vibrate: [Int]
The vibration pattern to use when alerting the user.
protocol Decodable
A type that can decode itself from an external representation.
protocol Encodable
A type that can encode itself to an external representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
protocol Sendable
init?(rawValue: String)
init(from decoder: any Decoder) throws
Creates a new instance by decoding from the given decoder, when the type’s RawValue
is String
.
var hashValue: Int { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
func encode(to encoder: any Encoder) throws
Encodes this value into the given encoder, when the type’s RawValue
is String
.
func hash(into hasher: inout Hasher)