In my app, user can set timer maximum seven times(1sec to 180sec each). For example, if user set 30sec and 30sec, device will be haptic two times (at 30sec and 60sec after run). In the foreground, it is well run.
But I want to run this timer in background also. So, I searched some ways.
- BGTaskScheduler
First, I figured out BGTaskScheduler. But I wonder it is appropriate way because example what I saw is about database. I mean longer period processing. I thought it is not appropriate for my app feature.
- UserNotifications
Then I figured out UserNotifications framework. And I read some documentation of the Apple.