I have migrated my project from using GCM to use Firebase. Push notification comes through ok when the device is awake or been asleep recently but if I leave the device for
Setting a time_to_live of 0 solved the problem for me.
I think it's because a very small time_to_live will tell FCM that this message is only worth delivering right this instant. So in an attempt to deliver it ASAP, it will ignore battery optimizations like the Android P's "app standby buckets".
Be careful though, as setting a small time_to_live might mean not delivering the notification at all in some cases. I don't think you should be applying it to all kinds of push notifications.
For more details about time_to_live: https://firebase.google.com/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message