user10949835
user10949835

Reputation:

How to get notification on firebase chat app using local notification?

How to get notification when the app is at the backgroenter code hereund or forced stopped?

I want to get a notification in the Android app using a broadcast receiver, Problem is that I have found solution when the app is opened. when app is opened I am able to receive notification. But when the app is killed or forced stopped I am not getting the notification. I want to know that how can i get notification when app is connected to the internet and get an notification even app is forced stopped.

Upvotes: 0

Views: 149

Answers (1)

Mahmoud Sabbah
Mahmoud Sabbah

Reputation: 94

There are two types of messages in FCM (Firebase Cloud Messaging):

  • Display Messages: These messages trigger the onMessageReceived() callback only when your app is in foreground
  • Data Messages: Theses messages trigger the onMessageReceived() callback even if your app is in foreground/background/killed

Firebase team have not developed a UI to send data-messages to your devices, yet. When your app is closed the notification submitted to your system, and can you retrieve the data in notification when you click on notification your application is started and in your launcher activity can you get the data intent

Upvotes: 1

Related Questions