How to program an app that sends notification when bluetooth disconnects

I am trying to create an app that can sense when the bluetooth module goes out of range and is able to open a notification to say so.
I have an Arduino uno and a HC05 bluetooth module. Any help would be great, because I’m new to the program and do not really understand the concept of bluetoothclient. I don’t really know how the code would even end up looking.
The bluetooth module is constantly sending a 1 byte message to the app. Maybe when the app doesn’t receive it it sends the notification?
I need like:
If bluetoothclient.isdisconnected
Then send notification “Bluetooth is disconnected”
(Also, I know that it already sends a notification when it cannot connect, but to reach the end product of my app, I need the notification to send.)

hey im a newbie too and i had this problem too but my bluetooth module is hc08 (bluetooth low energy) and i found a solution maybe you could use it as a reference idk maybe it might help you. as u can see i set the Bluetooth to autoreconnect so if its not connected and bytes are not being recieved it will auto reconnect and if it cant it would say its disconnected which will trigger a notification. i think this block only comes with the ble extension.

Dear Maggie,
I've just developed a couple of days ago, an app that behaves like a BT gateway between a smartphone and an Arduino, which is equipped with a HC06.
In attachment you can find the .aia, the Arduino code (in txt format) and a document that explains all the HW and the SW (at least in my thought :grin: ).
It operates on the basis of a watchdog (more or less). In few words: the Arduino board sends an "alive" character to the app every two seconds. If the app does not receive the "alive" character, it tries to reconnect the Arduino. Of course if Arduino is "dead" the app hangs in trying to reconnect it. If you want that after a certain number of retries it sends out a notifier you have just to modify the app in that sense.
I hope it helps.
Cheers, Ugo.
SMS_BT_IOT_ino.txt (8.6 KB)
IOT_SMS-docx.pdf (351.2 KB)
SMS_BT_Gateway.aia (1.7 MB)