Open Beckmann0o opened 2 weeks ago
I'm also getting same issue when use android:foregroundServiceType="shortService" then it works only 3 minutes when use android:foregroundServiceType="dataSync" then max 40 minutes
Is there any way it should work two or more days without crashing.
Hello Guys, good morning. Implement Background Actions to perform a task by calling a native module that scans BLE devices, if I use the cell phone frequently the foregroundservice runs perfectly throughout the day. The problem comes when the screen turns off for several hours, I find that the OS kills the service since I don't see it in the silent notifications. Activate without restrictions to save battery in my app, also in the foregroundservice type I configure it as follows: Option for notification:
<service android:name="com.asterinet.react.bgactions.RNBackgroundActionsTask" android:foregroundServiceType="connectedDevice|dataSync|location">
I also went on to configure the notification and the task performed below: O `const options = { taskName: 'BLEScanner', taskTitle: 'Escáner BLE Activo', taskDesc: 'Buscando dispositivos W6...', taskIcon: { name: 'ic_launcher', type: 'mipmap', }, color: '#FF0000', parameters: { delay: 15000, },
};`
Task configuration:: `const sleep = (time) => new Promise((resolve) => setTimeout(() => resolve(), time));
const veryIntensiveTask = async (taskDataArguments) => { console.log("Iniciando tarea de escaneo en segundo plano"); let lastPanicSendTime: Date = null;
}; ` Is there any specific configuration or anything I can change to make my foregroundservice more reliable and resilient to being killed by the operating system when the screen is off for several hours? THANK YOU SO MUCH !