Skip to content

Fixes foreground service not stopped when app gets destroyed#40

Merged
Sithira merged 1 commit into
Sithira:masterfrom
JanStorm:issue-22
Nov 7, 2021
Merged

Fixes foreground service not stopped when app gets destroyed#40
Sithira merged 1 commit into
Sithira:masterfrom
JanStorm:issue-22

Conversation

@JanStorm

Copy link
Copy Markdown

This issue is android-only.
Using flutter plugin flutter_plugin_android_lifecycle we can register a listener for app destroy event.
When app gets destroyed, we want the foregroundservice to stop. Otherwise wenn we reopen the app, the plugin cannot connect to the running service and gets buggy.

We have to do this logic in platform-specific code, since _channel.invokeMethod wont work on flutter side when trying to call stop via WidgetsBindingObserver. See issue flutter/flutter#65538 and related issue #21.

Using flutter plugin flutter_plugin_android_lifecycle we can register a listener for app destroy event. We have to do this logic in platform-specific code, since _channel.invokeMethod wont work on flutter side
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants