Forground and background Chat issue with websocket and flutter

26 Views Asked by At

I've created a chat system with socket functionality, managing to store and display messages. Yet, I'm struggling to receive messages when not on the chat page or when the app is terminated. I attempted solutions like provider state management and WorkManager but encountered no success. My goal is to receive messages even in scenarios where I'm not actively on the chat page or when the app is terminated.

1

There are 1 best solutions below

0
Omar Saad On

You might consider using flutter_background_service to be able to keep the connection open with the server while the app is in background or terminated.