init(direction:language:tag:icon:badgeIcon:vibrate:shouldRenotify:isSilent:requiresInteraction:)

Initialize notification options.

Notification.swift:470
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)

Parameters

direction

The language direction for the notification. Defaults to auto.

language

The language tag for the notification. Defaults to nil.

tag

The tag to deduplicate or replace presentation of the notification. Defaults to nil.

icon

A URL for the icon the notification should use. Defaults to nil.

badgeIcon

A URL for the badge icon the notification should use. Defaults to nil.

vibrate

A vibration pattern the notification should use. Defaults to nil.

shouldRenotify

A preference indicating if the notification with the same tag should be re-presented. Defaults to false.

isSilent

A preference indicating if the notification should be presented without sound or vibrations. Defaults to false.

requiresInteraction

A preference indicating if the notification stays on screen until the user interacts with it. Defaults to false.

Other members in extension

Types

  • enum Direction

    The language direction for the notification’s title, body, action titles, and order of actions.

Instance members

  • 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.