I am creating an application that shows a timer. When the timer reaches 0 seconds, a sound is played. I am using React Native Sound to play. I use the interval on componentDidMount to count seconds:
componentDidMount() { this.recalcTotalSeconds(); KeepAwake.activate(); this._interval = setInterval(() => { this.step(); }, 999); }
It works well while the phone is unlocked. When the phone is locked, the interval does not work , and the sound does not play. As a first measure, I downloaded the Keep Awake version that prevents screen locks. I am looking for a user friendly solution.

How to set a timeout to wake up the phone or at least play a sound to warn the user about unlocking the phone? How to play in the background when the phone is locked?
source share