docs: update installation guide android section
since this library want to make forever running background tasks, it is not possible to use android:foregroundServiceType="shortService" since it will be killed after 3 minutes. refer to this Android Documentation. so we use android:foregroundServiceType="dataSync" instead.
This PR will close #228
since this library want to make forever running background tasks, it is not possible to use
android:foregroundServiceType="shortService"since it will be killed after 3 minutes. refer to this Android Documentation. so we useandroid:foregroundServiceType="dataSync"instead.This PR will close #228
i am using dataSync but my background task that is simply just a console log iterration is stoping after 30 secs on android 12+ but task is working fine for android below 12 like android x i have tested
My App crashes as soon as it tries to start the foreground task with runtime exception.I have included android:foregroundServiceType to be dataSync and connectedDevice as the app uses ble and also needs to upload information.
<uses-permission android:name="android.permission.WAKE_LOCK" />
Above are ther permissions included in the AndroidManifest.xml file and App uses
PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN, PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT, PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS,
with PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, runtime permission.
Error which i get is E AndroidRuntime: java.lang.RuntimeException: Unable to start service com.asterinet.react.bgactions.RNBackgroundActionsTask@dee0a74 with Intent { cmp=com.sim.simsim/com.asterinet.react.bgactions.RNBackgroundActionsTask (has extras) }: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service com.sim.simsim/com.asterinet.react.bgactions.RNBackgroundActionsTask