Can I execute code when posting local notification on iOS?

I didn't find it anywhere and I think it's possible with push notifications. I would like it to delete previous notifications and do some more in here, but don't know if it's even possible.

Upvotes: 1

Views: 360

Answers (1)

Paulw11
Paulw11

Reputation: 115002

If the user taps on the local notification, then your app will be launched, but your app does not execute when iOS displays a scheduled local notification.

You may want to explore "background fetch" mode as an alternative method of periodically executing in the background. When your app is woken for background fetch you can take the opportunity to schedule/re-schedule local notifications

Upvotes: 1

Related Questions