I'm new and currently working on a Xamarin.IOS app based on a Xamarin.Android app. I noticed that the Android native app does background tasks using a class called Service
from Android.App
and classes from Android.Support.V7.App
and Android.Content
. I'm just wondering if there's any similar solution for Xamarin.IOS, or do I have to do it completely from scratch?
From document Backgrounding in Xamarin.iOS,we know that:
In iOS, backgrounding is recognized as an application state, and apps are moved in and out of the background state depending on the behavior of the app and the user. iOS also offers several options for wiring an app to run in the background, including asking the OS for time to complete an important task, operating as a type of known background-necessary application, and refreshing an application's content at designated intervals.
IOS regulates background processing very tightly, and offers three approaches to implement it:
For more details, you can check:https://learn.microsoft.com/en-us/xamarin/ios/app-fundamentals/backgrounding/introduction-to-backgrounding-in-ios.