Dismiss IOS Notification from NotificationContentExtention

Is it possible to dismiss/cancel a local notification from a button with in NotificationContentExtension?

I was only able to dismiss the NotificationContentExtension itself, but not the entire notification.

if #available(iOSApplicationExtension 12.0, *) {
          self.extensionContext?.dismissNotificationContentExtension()
}

Source: Ios