addNotification(_:alertingContext:)
Provides a new notification for display on your accessory.
Declaration
func addNotification(_ notification: AccessoryNotification, alertingContext: AlertingContext) async throws -> BoolParameters
- notification:
The notification to add.
- alertingContext:
Context for evaluating whether the notification can alert or be delivered quietly.
Return Value
true if the accessory alerted for the notification, false otherwise. If this method throws an error, the system assumes the accessory did not alert.
Discussion
Parse the notification details, select the information to display on your accessory, and convert it to data for transmission. Return true if your accessory successfully alerts for the notification.