1

I’m currently developing a timer app for android and iOS. I really care more about iOS for the time being, and even after following Xamarin’s documentation on backgrounding, using messaging center calls to the appDelegate.cs class and then launching a background task with the platform specific code, I’m still having my app terminated.

Is there any way to put an iOS app as a foreground service, like on android. Or is a background service still the way to go? I am trying to allow the user to set a timer up to 23 hours in advance and show count down.

  • 1
    There is no direct equivalent to a continuously running Android Foreground Service on iOS. iOS only allows certain types of app "Capabilities" to continuously run in the background, i.e. an audio player, a location tracker, etc... iOS 13 did add `BGTaskScheduler` to do things like processing photos and tagging objects in them (ML training and/or processing), database cleanups, etc... at certain intervals while the phone is charging, you have (non-metered) wifi network access, etc. You can use `EventKit` to create future calendar and reminder events, but not a continuous backgrounded process. – SushiHangover Aug 27 '20 at 04:11

1 Answers1

0

To those interested, another strategy I found was just setting a notification to go off, regardless of if the app is running or not. Then, you can just handle persistence instead of trying to make the app keep running!

Good luck to everyone!