2

I've been running through this for along time and i'm still stuck.

I'm working on a chat app using Flutter/Dart that it's based on Websocket . I would like to keep the state of a connected user alive even if he terminates the app. At this moment :

Foreground : Fully working

Paused : Fully Working

Background : Fully Working

Terminated : Not Working

I'm using Websocket_manager as a package to help

Thank you for your time.

Outail Ouni
  • 113
  • 1
  • 4

3 Answers3

0

I think this is not possible, you can try something like Firebase cloud messaging (link here), or something similar.

Boris Grigorov
  • 342
  • 3
  • 9
0

I'm working with FCM for the notifications and sometimes when the app is terminated and phone is locked. it doesn't receive notifications. I don't know what i should use right now :/

Outail Ouni
  • 113
  • 1
  • 4
-1

I am working on same solution, trying to keep app in the background - similar to what is Viber, WhatsApp, Signal etc doing. If I get it working, will share complete project. I have setup FCM google messaging and next bit is to have websocket. It does happen that notification from FCM does not go through.

If someone can explain how Viber, Signal and other can keep apps running and with 99 or 100% delivery rate.

UPDATE:

I have not try this yet but looks promising https://github.com/ppicas/flutter-android-background

And HowTo:

https://medium.com/stuart-engineering/keep-flutter-running-background-on-android-6ffc85be0234

Maka
  • 371
  • 3
  • 14
  • not work at all, besides stop post libs aren't maintained and 4 years didn't update. – Nicholas Jela May 13 '23 at 08:32
  • Have you gone mad because of it or you could post solution and "be smart"? I haven't posed "solution" but more as research. And by the way I have application running in the background. – Maka Jun 17 '23 at 21:39