Send notification to status bar if app is in foreground

Viewed 143

When I am receiving a push notification from Firebase Cloud Messaging and my app is in background I receive this notification to android's syste status bar. However if my app is in background I do not receive it but instead onMessageReceived is raised.

Is it possible to show this notification if app is in foreground mode? I know I can use NotifictionManager and build this notificatioin manually but there should be an easier way which Firebase SDK uses if app is in background. Like

class FcmService: FirebaseMessagingService() {
    override fun onMessageReceived(message: RemoteMessage) {
        showNotificationInStatusbar(message)
    }
1 Answers
Related