Search code examples
firebasekotlinpush-notificationfirebase-cloud-messaging

Why Firebase push notification work only when App is closed


I don't receive any notification when my application is open. Is this normal? I just receive push notifications when my app is closed. My service is:

<service
     android:name=".FirebaseNotificationService"
     android:exported="false">
     <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT"/>
      </intent-filter>
</service>

Solution

  • This is working as intended. Messages received when in foreground will be handled in onMessageReceived(). Similar post answered here.