is it possibe to drop the push notification in ios

I have a requierement like if local storage id and push payload id
matches then only display the notification in notification bar or else drop the notification.In foreground i can drop using callback method
Code Block
willPresentNotification

but am unable to find any solution when the app is in background or inactive. Please suggest me is it possible to drop notification, if yes please suggest the solution.
Code Block