I have an app that uses NotificationServiceExtension and it works great.
There is a function inside this extension that calculates the distance of the notification from user and shows in the title.
I want to prevent the app from showing notification based on userDefaults/any condition. Like if (distance>x) don't show the notification.
if I do this, if(condition_met){show} in extension, it delivers the original push by calling serviceExtensionTimeWillExpire.
Please help me on this, I want to prevent any notification if certain conditions aren't met. As we required user location here to measure distance, this can't be done on server side.
Discard push from NotificationServiceExtension
Add a Comment