After a certain time on iOS, the app stops working in the background.
hi i have a function, this function send message to server background,but after a certain time it stops working in the background
Next week I plan to test iOS, but on Android so far:
- The service triggers an event every 30 minutes.
- The service stops triggering when the phone is in stand-by/sleep mode, but works again when the mobile is active.
Providing more details from your side, could help others reproduce the issue or provide hints.
on ios, we use background_fetch or BGTaskScheduler. So, you can look for documentation information and its limitations.
After sending the iOS App (on a simulator) to inactive, the background service works for around 30 seconds and then it stops:
flutter: FLUTTER BACKGROUND SERVICE: 2022-06-22 08:56:51.986918
flutter: AppLifecycleState.inactive flutter: AppLifecycleState.paused
flutter: FLUTTER BACKGROUND SERVICE: 2022-06-22 08:56:56.988270
flutter: FLUTTER BACKGROUND SERVICE: 2022-06-22 08:57:01.990192
flutter: FLUTTER BACKGROUND SERVICE: 2022-06-22 08:57:06.986823
flutter: FLUTTER BACKGROUND SERVICE: 2022-06-22 08:57:11.987414
flutter: FLUTTER BACKGROUND SERVICE: 2022-06-22 08:57:16.988718
flutter: FLUTTER BACKGROUND SERVICE: 2022-06-22 08:57:21.986498
@udiedrichsen iOS doesn't have long running background services like on Android.