OnMessageReceived not fired if application in background

前端 未结 1 415
长发绾君心
长发绾君心 2021-01-26 16:47

I\'ve been developing android apps for a while now and all of them have FCM integrated in them and functioning properly.

I have this app that the onMessageReceived isn\'

相关标签:
1条回答
  • 2021-01-26 16:54

    Using Firebase, you can send two type of notifications message basically.

    1. Notification messages : sometimes thought of as "display messages."

    2. Data/Payload messages : which are handled by the client app.

    both above Notification has different behaviour, depending upon if your app is in foreground or background.

    1.Notification msg + Background : delivered to the notification tray

    2.Notification msg + Foreground : onMessageReceived() on Android

    3.Data msg + Background : apps receive the notification payload in the notification tray, and only handle the data payload when the user taps on the notification.

    4.Data msg + Foreground : your app receives a message object with both payloads available.

    For more clarification check this.

    For sending Data/payload message using FCM console use Advance option and insert key and value.

    0 讨论(0)
提交回复
热议问题