Concept 1 will not work as soon when phone is locked unfortunately, due to cordova limitations. Generally should probably be done with the accelerometer data.
Concept 2 It is possible to send some push notifications with some third party services via js api but it brings you back to problem with concept one , as far as app can not properly run in a background.
Still idea is cool , and you can probably easily create it with more standart and application(not a game) focused tools like Android studio/Xcode.
Thank you for your prompt reply and ideas you provided.
I've also contemplated using the accelerometer along with an 'On any touch' event to detect even the gentlest phone movement.
You're absolutely correct regarding locked phones. But Android phones can be easily configured to lock after a specified duration, or that feature can be turned off. Additionally, there might be an option to disable the lock button on a phone.
However, you pointed out a significant challenge. Cordova does have its limitations, and currently, I'm uncertain about how to address the issue of someone simply closing the app when the alarm is triggered. It's a challenge I'm still trying to solve🤔
UPD:I believe it's possible to partially address this issue by enabling 'play in the background' on the Audio object. However, it's important to note that the app can still be easily closed, and unfortunately, this seems to be an unavoidable challenge.