【发布时间】:2017-05-21 20:31:22
【问题描述】:
我正在尝试从我的 ArrayMap 中获取消息,但我无法访问 ReceiveMessage 包。 我尝试直接访问Map,但是非常错误
我的代码
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);
}
}
【问题讨论】:
-
您不是直接访问地图,而是调用返回它的方法。为什么你认为这是错误的?
标签: android firebase firebase-cloud-messaging