Search code examples
flutterwebsocketreal-time-updates

How to get real-time notifications in Flutter


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


Solution

  • 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.