How to detect incoming message in Flutter

Viewed 350

please I need a guide that may help me develop a function that can detect incoming messages when app is not in use or terminated in Flutter. I think of background_fetch package that can be useful but its interval time is 15 mins but I want it to be running continuously so that it can listen to the message when the app is completely offline or terminated like how WhatsApp works. Thanks in advance.

1 Answers

Try to learn more about push notifications..

  1. Push notification notifies user about the new message.
  2. When user click on it, you can transfer some data from the notification to your app.
  3. In your app you are listening this data, if data recived it means that user tapped to the push notification, and you can handle it, for example open certain chat.
Related