Perhaps try this with a run in Background extension might work. You need either an accelerometer or orientation sensor or gyroscope. This example uses an accelerometer.
You will need to adapt the code using an accelerometer for your falling phone situation (actually code used to detect a fall person is the same as the developer can only detect a fall in that case only if the person has a phone in the hands or on their person,
The app would have to run in the Background and the phone turned on.