確實有。只是覆蓋FirebaseMessagingService.onMessageReceived
並獲得通知身體從火力地堡雲端通訊文檔這個例子:
@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.
Log.d(TAG, "From: " + remoteMessage.getFrom());
Log.d(TAG, "Notification Message Body: " + remoteMessage.getNotification().getBody());
}
見receiving downstream messages on Android下「覆蓋onMessageReceived」的火力地堡雲端通訊文檔。
[this](http://stackoverflow.com/a/37845174/5296734)可能適合你! –