flutter_foreground_task icon indicating copy to clipboard operation
flutter_foreground_task copied to clipboard

Urgent: Foreground is stopped working when device is lock and not charging

Open Tahahalabi opened this issue 3 years ago • 8 comments

I added these permissions

// App is asking about this permission await FlutterForegroundTask.requestIgnoreBatteryOptimization();

also I put these channelImportance: NotificationChannelImportance.HIGH, isSticky: true, priority: NotificationPriority.HIGH,

but when my device is not charging and it's lock, foreground not working, it is working when I enter to app again, if my phone is charging, it will works fine even if my device is lock

Tahahalabi avatar Aug 26 '22 19:08 Tahahalabi

???

Tahahalabi avatar Aug 30 '22 09:08 Tahahalabi

@Tahahalabi . Some device manufacturers kill apps regardless of anything and everything. You either have to disable your manufacturers battery saver from the settings. Please take a look at https://dontkillmyapp.com. @Dev-hwang i recommend this issue closed.

h2210316651 avatar Aug 30 '22 12:08 h2210316651

No problem didn't solve yet, so issue will not be closed

Tahahalabi avatar Aug 31 '22 02:08 Tahahalabi

I checked what you sent, it's not a solution, my app is asking for the battery permission to reject it

Tahahalabi avatar Aug 31 '22 02:08 Tahahalabi

It seems to be related to doze mode. Some device may require the android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS permission.

Are you using another plugin in your implemented TaskHandler? Or are you using the network?

Dev-hwang avatar Aug 31 '22 03:08 Dev-hwang

no I'm only using your plugin

Tahahalabi avatar Aug 31 '22 05:08 Tahahalabi

There is another plugin for background installed but I'm not using it

Tahahalabi avatar Aug 31 '22 05:08 Tahahalabi

I told you I'm using this android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS

Tahahalabi avatar Aug 31 '22 05:08 Tahahalabi