Swift - clear notification queue when app is terminated by system

Viewed 10

I am building an app which contains a timer. I have notifications that are setup to notify the user when the timer is complete, but there's one area I'm having trouble with.

If the app is terminated by the user, applicationWillTerminate is called and any pending notifications are cancelled before termination. However, if the app is killed by the system first (for example after being in the background for a long time) and then killed by the user by removing from app switcher, the notification queue isn't cleared and the user still gets a notification.

Is there any way to resolve this?

Thanks.

0 Answers
Related