Android app in Samsung tablet (t590) does not notify until screen is unlocked

$(subj)
Does not always happen, sometime they go through. I googled a lot of articles about Samsung stuff none provide stable result by which I mean “play notification sound every time within 10min interval” - it plays for a few times and in a minute or so the device is kind of asleep but responds to pings. Background access is enabled, power management disabled, and so on, does this sound any familiar?

The ultimate goal is to make the tablet act as a door bell.

Check that your app can run in the background and that persistent connections is allowed.
It should all be visible in the app configuration.

This is only required if your device has no Google services and you need notifications. If the device has Google services then this is not needed.

As OP has a Samsung device then they need to dig deeper into device settings as Samsung likes to add many additional battery saving techniques that cause background access issues.

Both background and persistent connection are enabled but yeah the major culpit is Samsung and its battery policy. It seems it has an allowed list (with dunno things like whatsapp and facebook) and HA app is just not there.

A much older Samsung tablet with Intel Atom inside and running lineageos does not have this problem, for example.