Skip to content

No way to get receivePort without restarting task handler #44

@insidewhy

Description

@insidewhy
  1. Open the app and start the task handler.
  2. Close the app (i.e. hit app switcher and swipe app away).
  3. Observe the isolate is still running and handling onEvent.
  4. Open the app via the notification button and observe that the related receivePort that was previously stored in memory is now null.
  5. Now there is no way to connect a ReceivePort to the isolate that is still running. You can call FlutterForegroundTask.restartService to get a new receive port, but this destroys your task handler which causes you to lose all the state you've accumulated in it.

If the isolate is lost once the app is stopped, then is there any point in still keeping it running? Or should I be constantly writing to shared preferences so that I can resume?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions