Class

NotificationResponseButton


Description

Class for actions which appear as a button for the user to press.

Methods

Name

Parameters

Returns

Shared

Constructor

caption As String, identifier As String, iconName As String = ""

Property descriptions


NotificationResponseButton.AuthenticationRequired

AuthenticationRequired As Boolean

If true, the device must be unlocked to display the action.


NotificationResponseButton.BringToForeground

BringToForeground As Boolean

If true, this action brings the app to the foreground.


NotificationResponseButton.Caption

Caption As String

The caption of the button for the action.


NotificationResponseButton.Destructive

Destructive As Boolean

If True, you are indicating that this action is destructive in some way.

A destructive action is one where the user will lose data in a way that isn't reversible or easily reversible.

The captions of destructive actions will be drawn in red. Despite this fact, the caption should make it very clear that the action is destructive.


NotificationResponseButton.IconName

IconName As String

The name of the icon.

The name must be either an SFSymbol, the name of an image in your project or the name of an image file in the root directly of the application bundle.


NotificationResponseButton.Identifier

Identifier As String

The value that will be passed to the NotificationCenter.UserResponded event.

This value allows you to know which action the user took when the NotificationCenter.UserResponded event is called.

Method descriptions


NotificationResponseButton.Constructor

Constructor(caption As String, identifier As String, iconName As String = "")

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Creates a new NotificationResponseButton and sets its caption, identifier and icon to the values passed.

The iconName can either be an SFSymbol or the name of an image in the app's bundle. In the case of a naming conflict, the SFSymbol will be used.

Notes

If the NotificationResponseCategory you're creating only requires Yes and No buttons in order for the user to response to the notification, your app should create two NotificationResponseButton objects, one for each button.

Compatibility

iOS projects on the iOS operating system.