Getting started with IOT and home security with ESP32/8266 and android

Hello all,

I'm looking to start getting into the world of ESP and IOT but looking around the internet I couldn't find a good solution for my requirements which are:

Having an app on the phone(Or some method that I don't know about) that will run in the background in low power just for push notifications(like how what's up messages show up instantly when you get a message even if the app is closed)

and all that not relying on any third party services (like PubNude) while hosting it all the the ESP MCU or some simpler server that can easily be created and interfaced with an app that is not connected to any third party service but can be configured to your server.

The goal is to have a live notification service for a door state detector(open/close) directly between the ESP device which will connect to the home Wifi and an android device.

Thanks for helping.