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