I send payload notifications from my server. here is an example:
url= "https://fcm.googleapis.com/fcm/send"
{
"to" : "userToken",
"data" : {
//some json here
}
}
this way, I successfully send messages to users, even if the application does not work, on all devices prior to Android O. But on the Android O device, onMessageReceived is not called when the application does not start ...
Are there any new rules in O? how can this be fixed? thank!
UPDATES
This question is not about notifications, but about messages about firebase srvice!
Anyway, for Android O are also available:
val CHANEL_ID = "MY_CHANEL_ID"
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = NotificationChannel(CHANEL_ID, "Channel human readable title", NotificationManager.IMPORTANCE_HIGH)
(getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager).createNotificationChannel(channel)
}
source
share