Android FCM notification issue

前端 未结 4 738
栀梦
栀梦 2021-01-07 06:50

I am struggling with FCM notifications on Android. The issue is only when the app is closed and not running. I am trying to achieve no click activity I don\'t want the app

4条回答
  •  孤独总比滥情好
    2021-01-07 07:22

    When application in background "OnMessageReceived" overridden method wont get called in general scenario.

    If you want to make "OnMessageReceived" method to call all the time. Ask your web service team to send only "DATA" payload. Dont use "Notify" or "Notification" payload.

    If "DATA" payload is send properly from backend then Android application will work on "OnMessageReceived" with a List of Data from RemoteMessage.getDATA();

    I struggled the same issue for nearly 2 days and finally got the above solution.

提交回复
热议问题