[英]When my android App get firebase message notification, then shutting down
[英]Android Firebase : how get the message text component of notification message from firebase when app is in foreground
當我們只有可以通過Firebase控制台發送的通知(顯示消息)時,當我們的應用程序位於Foreground中時,將調用FirebaseMessagingService的onMessageReceived方法。 為了獲得通知,我創建了工作正常的通知生成器。 我面臨的唯一問題是檢索消息內容,因為它不是數據通知,所以remotemessage.getData()為null,甚至remotemessage.getNotificationBody()也為null。 我已經調試了程序,remoteMessage具有一個字段來存儲發送的消息,但我無法檢索它。 請幫我。 隨附的快照顯示了從Firebase控制台發送的必填消息字段,並以黃色突出顯示。
我明白了..它是如此簡單::) getNotification()。getBody();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.