Dev-hwang / flutter_foreground_task

This plugin is used to implement a foreground service on the Android platform.
https://pub.dev/packages/flutter_foreground_task
MIT License
140 stars 105 forks source link

Problems with a released iOS app in the background #209

Closed nasko25 closed 1 month ago

nasko25 commented 6 months ago

Hello

Everything works as expected when I test a release build from xcode/flutter, but when I submit my app to the App Store and test closing the app from there, the background execution halts until I open the app again. I am wondering whether I need to enable some additional capability/configuration.

This answer: https://forums.developer.apple.com/forums/thread/119738, and https://developer.apple.com/documentation/xcode/configuring-background-execution-modes make me think we need to enable the Background Modes capability through xcode in order for it to properly work.

Do you think this should be the case? If so, maybe a note in the readme would also be appropriate.

Thanks in advance.

nasko25 commented 5 months ago

It appears iOS is indeed quite limiting in that regard.

I am investigating beginBackgroundTask from https://developer.apple.com/documentation/backgroundtasks/choosing-background-strategies-for-your-app#Continue-Foreground-Work-in-the-Background but I can't seem to get a conclusive result for my app. Even with that API we can only hope for around 30 seconds of background activity.

I'd really appreciate any previous findings, and whether you have done something similar in the past.