Joe Altidore
01/25/2024, 3:18 PMclass 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?Joel Denke
01/25/2024, 5:07 PMJoe Altidore
01/25/2024, 5:08 PMJoel Denke
01/25/2024, 5:15 PMFrank Bouwens
01/26/2024, 10:27 AMJoel Denke
01/26/2024, 10:38 AMFrank Bouwens
01/26/2024, 10:40 AMJoel Denke
01/26/2024, 10:41 AM