Firebase onMessageReceived not called when app is in the background

后端 未结 4 1890
感情败类
感情败类 2020-11-28 11:38

I am using Firebase for our messaging service in our Android app. I have researched Firebase quite a bit and I understand that whether the app if running in the foreground o

4条回答
  •  误落风尘
    2020-11-28 11:56

    In this post , answer of Koot might be your solution. He said "I had the same problem. It is easier to use the 'data message' instead of the 'notification'. The data message always load the class onMessageReceived."

    my solution is as per his advice

    {
      "condition": "'reader' in topics",
    
      "data": {
        "title":"Please Check",
        "message": "This is a Firebase Cloud Messaging Topic Message 5!"
       }
    }
    

提交回复
热议问题