Contents

removePendingNotificationRequests(withIdentifiers:)

Removes your app’s local notifications that are pending and match the specified identifiers.

Declaration

func removePendingNotificationRequests(withIdentifiers identifiers: [String])

Parameters

  • identifiers:

    An array of Nsstring objects, each of which contains the Identifier of an active Unnotificationrequest object. If the identifier belongs to a non repeating request, and the trigger condition for that request has already been met, this method ignores the identifier.

Discussion

This method executes asynchronously, removing the pending notification requests on a secondary thread.

let center = UNUserNotificationCenter.current()
center.removePendingNotificationRequests(withIdentifiers: ["com.example.mynotification"])

See Also

Scheduling notifications