Majd Harb
Majd Harb

Reputation: 85

How to Keep flutter app running in background (prevent from being killed)

I have a flutter app that connects to a web socket to send the location of a taxi driver.

The user is a taxi driver who receives a notification containing coordinates, when he accepts the notifications he is redirected to Google Maps app. However, after a while, the app will be killed and removed from the background and I won't be able to track the driver (since the socket will disconnect).

Is there any way to keep the app running in the background (creating a background process for example)? Or is there something that detects when the driver exists and minimizes the app to keep it running in the background (bubble just like Facebook messenger)?

Please help I've been stuck on this for a very long time.

Upvotes: 2

Views: 2451

Answers (1)

ramsy0dev
ramsy0dev

Reputation: 21

Check out workmanager i think it's what you may need

Upvotes: 2

Related Questions