I tried to use react-native-background-actions to start the microphone and recognition in background service, but microphone closes the moment I kill the app, simple counter in the same task continues to work.
Maybe you have some advices or thoughts about this idea, I would really appreciate it.
I run the task like this (just in case):
`await new Promise(async resolve => {
// open microphone, start recognize. works when app isn't killed
startSpeechRecognition();
// loop that works always
for (let i = 0; BackgroundService.isRunning(); i++) {
console.log('Runned -> ', i);
await BackgroundService.updateNotification({ taskDesc: ' i -> ' + i});
await sleep(delay);
}
});`
I tried to use react-native-background-actions to start the microphone and recognition in background service, but microphone closes the moment I kill the app, simple counter in the same task continues to work. Maybe you have some advices or thoughts about this idea, I would really appreciate it.
I run the task like this (just in case):