FCM receive message Issue

2020-04-17 18:56发布

I'm integrating FCM to my project. But I'm getting below error in Log while notification received. (Error text color is blue)

W/FirebaseMessaging: Received message with unknown type: text

My code is like this:

public void onMessageReceived(RemoteMessage remoteMessage) {
        Log.d("Notification", "Success");
        sendNotification(remoteMessage);
}

In this code, the first line is not executing and it is not debugging also.

1条回答
▲ chillily
2楼-- · 2020-04-17 19:30

Finally I got the solution

In php side I'm sending

"message_type":"text"

That's why I got above error.

As "message_type" keyword is predefined by FCM so it is conflicting. So change that keyword in PHP code.

查看更多
登录 后发表回答