Cancel or stop push notification from UNNotificationServiceExtension?

I have UNNotificationServiceExtension implemented for my iOS app running iOS 10. Everything works fine. I want to stop APNS push notification from happening on client side on certain notifications, I tried modifying

self.bestAttemptContent = nil;

but it didn't work. Is it possible? How?

Replies

Did you ever find a solution to this problem? I have need to cancel the user facing notifications as well. The reason being that, due to encryption, our server can't see into a message to know whether a user-facing notification is appropriate or not. This can't be determined until the client decrypts the message.