4

I am new in Flutter, I have used web_socket_channel in my app. Now I want to get notifications when the app is not running. Keeping the app running in the background is not possible, so what do you recommend me to do?

So far I found them:

Websocket Manager- They claim to open socket connection in the background, but I couldn't find enough resources to find out. https://pub.dev/packages/websocket_manager

Background Fetch - Opens the app for a few seconds in the background periodically (15 minutes or more). I do not prefer this one actually :( . https://pub.dev/packages/background_fetch

Greedy Pointer
  • 334
  • 5
  • 12

1 Answers1

2

You can use firebase_messaging, it's easy to implement in android and got a bit of configurations to do in IOS but it's good.

Qonvex620
  • 3,819
  • 1
  • 8
  • 15
  • I am using, Django in Back-end with Postgres, am I still able to use firebase_messaging? – Greedy Pointer Mar 03 '20 at 08:20
  • yes of course you will just setup a listener to your main page's initState and the other process is up to you, you can use onMessage, onResume, and onLaunch. once implemented properly its good – Qonvex620 Mar 03 '20 at 08:24
  • make sure to connect your back office to firebase as well – Qonvex620 Mar 03 '20 at 08:25
  • Thank you so much, I am going to implement it today:) – Greedy Pointer Mar 03 '20 at 08:26
  • Qonvex620 hey I am facing almost the same problem as Orkhan. As you said to make sure to connect with firebase. I don't want to use firebase at all.I am using a sockeapi.Is there any solution for getting notifications with data even after my app is kiiled? – Shariar Saimon May 27 '20 at 16:02
  • I have to implement notification using an APIs and I have tried firebase messaging but couldn't implement that. Any solutions or suggestions ? – Mukta Dec 26 '20 at 19:25