Hello guys! I am trying to implement firebase push...
# firebase
j
Hello guys! I am trying to implement firebase push notifications but when the app is open, the notification does not come in. This is my FirebaseService class
class FirebaseService : FirebaseMessagingService() {
init {
Log.d("TAG", "onMessageReceived: ")
}
override fun onNewToken(token: String) {
super.onNewToken(token)
Log.d("TAG", "onNewToken: $token")
}
override fun onMessageReceived(message: RemoteMessage) {
super.onMessageReceived(message)
Log.d("TAG", "onMessageReceived: ${message._notification_?._title_}")
}
}
I have also added this class to my manifest as shown below
<service
android:name=".FirebaseService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGIN_EVENT"/>
</intent-filter>
</service>
However, when the app is in the background, I receive notification on the notification tray but when the app is open, I expect to see the log message in the onMessageReceived method which never triggers. What am i missing?