flutter_background_service icon indicating copy to clipboard operation
flutter_background_service copied to clipboard

After a certain time on iOS, the app stops working in the background.

Open ibrahimcss opened this issue 3 years ago • 4 comments

hi i have a function, this function send message to server background,but after a certain time it stops working in the background

ibrahimcss avatar Jun 11 '22 00:06 ibrahimcss

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.

asashour avatar Jun 15 '22 10:06 asashour

on ios, we use background_fetch or BGTaskScheduler. So, you can look for documentation information and its limitations.

ekasetiawans avatar Jun 15 '22 10:06 ekasetiawans

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 avatar Jun 22 '22 07:06 udiedrichsen

@udiedrichsen iOS doesn't have long running background services like on Android.

ekasetiawans avatar Jun 22 '22 08:06 ekasetiawans