I would like to create an alarm clock app and have found apps in the app store that do exactly what I want to achieve.
e.g. ring in 8 hours, the apps regulate the volume in the background of the music that is then played -> so the app has to run in the background. I came across the following point in the documentation:
I needed a way to play a sound at a certain time even though the app is in the background. The problem is that the app is paused as soon as it goes into the background, you can delay this by 30 seconds, but if you take longer, the app is stopped and no more code is executed. Now I have found a...
BGTaskScheduler is not suitable for alarm clock app. It doesn't let you run a task at a specific time. It is similar to the "background fetch" feature.
Unfortunately, this is not a solution. For example, I always have my phone on silent, so I would never hear the alarm and I also always have to make sure that I have the sound at a volume that I can hear. While the alarm clock apps regulate the volume while the music is playing.
Referring to this Background Modes: https://stackoverflow.com/questions/57197958/what-is-the-xcode-background-processing-background-mode/66390232#66390232 I've been able to identify the UIBackgroundModes keys for "audio", "location" and "fetch", but not for the "Background Processing Task" mode...
my use case was not about scheduling task rather than having the app not suspended upon going in background.
apparently it allows the app to run even while not in foreground.
i don't know for how long though, since for my app need only some minutes
But somehow the whole thing only works in the IOS simulator. Nothing happens on my Iphone when the app is in the background. I have already switched to VideoPlayer. But even the timer that controls the whole thing is only triggered when I bring the app back into the foreground. It works reliably in the simulator...
I needed a way to play a sound at a certain time even though the app is in the background. The problem is that the app is paused as soon as it goes into the background, you can delay this by 30 seconds, but if you take longer, the app is stopped and no more code is executed. Now I have found a...