How to make it so that when an application is in a back-grande, push notification is not sent immediately to the notification center , but processed by the application using the onMessageReceived method? Push done on firebase .
|
3 answers
Send data messages (without the Notification object)
With FCM, you can send:
Notification messages, sometimes thought of as "display messages."
Data messages, which are handled by the client app.
Client app is responsible for processing data messages. Data messages have only custom key-value pairs.
FCM to handle displaying a notification on your client app's behalf. On your client app.
- oneTry to write more detailed answers. Explain what is the basis of your statement? - Nicolas Chabanovsky ♦
- And how can I send data messages? - Bullshit
- From the documentation "Use your app server and FCM server API: Set the data key only. Can be either collapsible or non-collapsible." , for example:
{ "to": "device_token", "data": { "key": "value" } }- hiiamfrankie
|
remove the super.onMessageReceived(remoteMessage); method super.onMessageReceived(remoteMessage);
|
I use the wonderful RxFcm library, there are classes in it that will help you do what you need without much difficulty
|