Hello,
If you want to execute task in the background service continually. You need to configure each specific platform.
For Android
Please check Background Execution Limits in Android 8.0, you cannot run a background service in the background continually.
If you can do it by creating a foreground service in MAUI. Then you can add scheduled code in the OnStartCommand
method.
For iOS Background tasks are under a strict time limit, and typically get about 600 seconds (10 minutes) of processing time after an application has moved to the background on iOS 6, and less than 10 minutes on iOS 7+, please refer to this document:iOS Backgrounding with Tasks
If your application could be registered following apps.
- Audio
- VoIP
- External Accessories and Bluetooth
- Newsstand
- Location
- Fetch (iOS 7+)
- Remote Notifications (iOS 7+)
Then you can creating Background-Safe Tasks and put your scheduled code in the UIApplication.SharedApplication.BeginBackgroundTask( () => {});
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.