Bluetooth disconnection alarm

Hello everyone. I hope you can help me.
I am a newbie, I am developing an app where I link via Bluetooth to an ESP32 module.
The problem is that when I unplug or move the ESP32 away I cannot configure an alarm to notify the user.
I saw several forums on the same topic, but the posts are so complex (and old) that I end up getting lost with so much information and my little knowledge.
Will anyone have a .AIA project to share with me? Maybe someone has a project where only these functions are. And this would be very helpful for me, so I can see how to implement it in my project.
From already thank you very much.

perhaps the advice here will work to let your user know when there is a disconnect: