Android Question FirebaseNotifications: msg box with notification

kelvo01

Member
Licensed User
Longtime User
when i recevie a notification Erel make notification ok.
if i click on a notification the app re-take control.
i what to put a msg box with notification.

How ?
 
Last edited:

kelvo01

Member
Licensed User
Longtime User
Not sure if i understand correctly - but if you want to have the number on the icon of the homescreen, this is not included in firebase nor notification.
This is called a badge. search the forum, there is a library for this, but i'm not sure if it works correctly on all devices.
the icon is not my primary problem
my promary problem is that I don't receive the message in fm_MessageArrived so if i click on the bar the app open ... but i want to display the message inside the app
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
if i click on the bar the app open

Read carefully:

There are 2 types of messages. Data only and WITH the notification part.

If the app is in background (=screen of/other app in foreground) FCM behaves differently:

1. WITH notification

Just a notification will displayed by the FCM service (nothing else). Then the user has to click the notification and the data has to be retrieved via intent

2. DATA ONLY

This is what you need. This will be received in the background like you need (in any case, even if the screen is turned off/other app is in foreground). You have to notify on your own.

https://firebase.google.com/docs/cloud-messaging/concept-options
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
There are 2 types of messages. Data only and WITH the notification part.

If the app is in background (=screen of/other app in foreground) FCM behaves differently:
This is not correct if you are using the B4J code (or similar B4X code) to send the message.
The message will arrive exactly the same whether the program is running or not.
 
Upvote 0
Top