link of structureFCM onReceivedMessage()获得捆绑
我想从我的ArrayMap的消息,但我无法访问ReceiveMessage束。 我试图直接访问地图,但它是非常错误的
我的代码
public class FbService extends FirebaseMessagingService {
public FbService() {
}
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
// TODO(developer): Handle FCM messages here.
// If the application is in the foreground handle both data and notification messages here.
// Also if you intend on generating your own notifications as a result of a received FCM
// message, here is where that should be initiated. See sendNotification method below.
Map<String, String> params = remoteMessage.getData();
String message = params.get(3);
Log.d("FbService", "Notification Message Body: " + message);
}
}
你是不是直接访问地图,你调用方法,它返回它。你为什么认为这是错的? – X3Btel
请参阅:https://stackoverflow.com/questions/42273699/how-to-stack-firebase-cloud-messaging-notifications-when-the-application-is-not/43914028#43914028 – Maddy