File
—> New
—> Targets
—> Application Extension
—> Notification Service Extension
.Product Name
and click on Finish
.didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent)
method under bestAttemptContent
condition. The below code shows how you can remove the notifications for call
type messages since we need to show the latest call notification.
sessionID
.
You can change the implementation as per your service. Once you added the code the above code add the completion handler in the main thread like shown below: