transistorsoft / react-native-background-fetch

Periodic callbacks in the background for both IOS and Android
MIT License
1.49k stars 193 forks source link

Android startOnBoot=true and stopOnTerminate= false not working as expected - the task tries to start on reboot of device but the app is killed every time. #431

Closed MarkoVidalisBreez closed 6 months ago

MarkoVidalisBreez commented 1 year ago

Your Environment

Expected Behavior

After seeing '[BackgroundFetch] configure status: 2' in the console when the background task is configured, I expect the package to spin up on rebooting the device and execute the code in the onEvent function.

Actual Behavior

The device seems to try to start the task, but the app is then killed before the task is executed.

Steps to Reproduce

  1. Create a new react native project (npx react-native init AwesomeProject)
  2. run 'yarn add react-native-background-fetch', and follow installation instructions for Android exactly as specified in the documentation.
  3. Copy sample code from Github into App.tsx file, and apply the following configuration: { minimumFetchInterval: 15, startOnBoot: true, stopOnTerminate: false, enableHeadless: false, forceAlarmManager: true, }
  4. Run the app on the device.

Context

I have an application which I have built, using react native 0.68.5 initially, which I needed to use this package for in order to start a foreground service in a native module which I have developed. So I installed and imported the package, followed all the steps for installation and configuration, and I can see the task is configured successfully with status 2 on android. Thereafter, I expected that the package would start the service whenever a device is rebooted, if the task has been configured of course. In my tests, I make sure the job is configured, then I restart the device. On restart, I see the following in my device logs: image The last 2 TSBackgroundFetch logs are showing me that the package is trying to run my code, but it never does. I have run tons of tests and fiddled with the configuration, enabling and disabling headless (which always logs HeadlessMode? true by the way even if I've specified enableHeadless=false), I've also played with the forceAlarmManager config but it always behaves in the same way. Thereafter, because there is a lot going on in the application, I decided to start a completely new react native project, and followed the steps as mentioned in the Steps to reproduce section of this issue. So now on the latest RN version, with no other dependencies installed or other code written, the package is behaving in exactly the same way and i don't think this is correct. The logs below are ALL of the logs from the time that the device reboots and tries to start the app, to the point where the app is killed.

Debug logs

--------- beginning of main --------- beginning of system 2023-01-27 17:17:54.681 1315-1315 MultiUserInstallPolicy pid-1315 I applyInstallPolicyPackageInternalLPw : com.bgtest 2023-01-27 17:17:58.185 1315-1315 StorageManagerService pid-1315 V Package com.bgtest does not have legacy storage 2023-01-27 17:18:16.028 1315-1594 SGM:GameManager pid-1315 D identifyGamePackage. com.bgtest, mCurrentUserId: 0, callerUserId: 0, callingMethodInfo: com.samsung.android.game.SemGameManager.isGamePackage(SemGameManager.java:104) 2023-01-27 17:18:16.028 1315-1594 SGM:PkgDataHelper pid-1315 D getGamePkgData(). com.bgtest 2023-01-27 17:18:16.028 1315-1594 SGM:SemGameManager pid-1315 D isGamePackage(), pkgName=com.bgtest, ret=false 2023-01-27 17:18:16.029 1315-1594 Pageboost pid-1315 I appinfo : com.bgtest 0 1 0 0 2023-01-27 17:18:16.797 1315-1594 Pageboost pid-1315 I pkg info : com.bgtest 2023-01-27 17:18:16.797 1315-1594 Pageboost pid-1315 I Reuse the dbinfo for this app info : com.bgtest /data/app/~~cDRyh8JxSiR4GzjgApJfjA==/com.bgtest-iYW5iqztO6_I28taX5v1PQ==/base.apk 2023-01-27 17:18:24.983 2159-4316 ItemInfoUtils pid-2159 I createItemInfoFromLauncherApps: com.bgtest/null, UserHandle{0} 2023-01-27 17:18:26.054 1315-1594 SGM:GameManager pid-1315 D identifyGamePackage. com.bgtest, mCurrentUserId: 0, callerUserId: 0, callingMethodInfo: com.samsung.android.game.SemGameManager.isGamePackage(SemGameManager.java:104) 2023-01-27 17:18:26.054 1315-1594 SGM:PkgDataHelper pid-1315 D getGamePkgData(). com.bgtest 2023-01-27 17:18:26.054 1315-1594 SGM:SemGameManager pid-1315 D isGamePackage(), pkgName=com.bgtest, ret=false 2023-01-27 17:18:26.054 1315-1594 Pageboost pid-1315 I appinfo : com.bgtest 0 1 0 0 2023-01-27 17:18:26.283 2159-4316 ItemInfoUtils pid-2159 I createItemInfoFromLauncherApps: com.bgtest/null, UserHandle{0} 2023-01-27 17:18:26.932 1315-1594 Pageboost pid-1315 I pkg info : com.bgtest 2023-01-27 17:18:26.932 1315-1594 Pageboost pid-1315 I Reuse the dbinfo for this app info : com.bgtest /data/app/~~cDRyh8JxSiR4GzjgApJfjA==/com.bgtest-iYW5iqztO6_I28taX5v1PQ==/base.apk 2023-01-27 17:18:27.577 2159-2297 HsWidgetPr...UpdateTask pid-2159 I 1. Predicted target com.bgtest#UserHandle{0} 2023-01-27 17:18:28.753 2159-2297 AppIconSolution pid-2159 I getThemeIconWithBG called with public API, pkg = com.bgtest 2023-01-27 17:18:28.761 2159-2297 AppIconSolution pid-2159 I start to load, pkg=com.bgtest, bg=192-192, dr=144-144, forDefault=true, density=480 2023-01-27 17:18:28.787 2159-2297 AppIconSolution pid-2159 I getIconScale, pkg=com.bgtest, size=144, iconScale=IconScale[alpha=15, scale=1.0, isCrop=true] 2023-01-27 17:18:28.925 2159-2297 AppIconSolution pid-2159 I default container[CROP], pkg=com.bgtest, bg=114-114, dr=144-144, isNight = true 2023-01-27 17:18:28.930 2159-2297 LauncherActivityInfo pid-2159 I packageName: com.bgtest, useThemeIcon: false, height: 114, width: 114, density: 480 2023-01-27 17:18:29.094 2159-2297 HsWidgetPr...UpdateTask pid-2159 I 1. Predicted target com.bgtest#UserHandle{0} 2023-01-27 17:19:10.155 1315-5642 SGM:GameManager pid-1315 D identifyGamePackage. com.bgtest, mCurrentUserId: 0, callerUserId: 0, callingMethodInfo: com.samsung.android.game.IGameManagerService$Stub.onTransact(IGameManagerService.java:242) 2023-01-27 17:19:10.156 1315-5642 SGM:PkgDataHelper pid-1315 D getGamePkgData(). com.bgtest 2023-01-27 17:19:10.157 8249-8285 DWBAndroidPackageCatego pid-8249 I com.bgtest was identified to Other(-1) 2023-01-27 17:19:10.158 8249-8285 DWBDbPackageCategorySou pid-8249 I update database cache to add com.bgtest as 'Other' 2023-01-27 17:19:10.990 8288-8311 GOS:DataUpdater pid-8288 I updatePackageList(), src pkgNameList, size: 71, [android.autoinstalls.config.samsung, com.android.chrome, com.android.settings, com.android.traceur, com.android.vending, com.aura.oobe.samsung.gl, com.bgtest, com.breez.app, com.disneyplus.mea, com.facebook.katana, com.google.android.apps.carrier.carrierwifi, com.google.android.apps.docs, com.google.android.apps.maps, com.google.android.apps.messaging, com.google.android.apps.photos, com.google.android.apps.restore, com.google.android.apps.tachyon, com.google.android.apps.turbo, com.google.android.apps.youtube.music, com.google.android.captiveportallogin, com.google.android.documentsui, com.google.android.gm, com.google.android.gms, com.google.android.googlequicksearchbox, com.google.android.ims, com.google.android.modulemetadata, com.google.android.networkstack, com.google.android.projection.gearhead, com.google.android.trichromelibrary, com.google.android.tts, com.google.android.videos, com.google.android.webview, com.google.android.youtube, com.google.mainline.telemetry, com.linkedin.android, com.microsoft.office.officehubrow, com.microsoft.office.outlook, com.microsoft.skydrive, com.netflix.mediaclient, com.samsung.accessibility, com.samsung.android.app.contacts, com.samsung.android.app.galaxyfinder, com.samsung.android.app.notes, com.samsung.android.app.watchmanagerstub, com.samsung.android.calendar, com.samsung.android.dialer, com.samsung.android.galaxy, com.samsung.android.lool, com.samsung.android.messaging, com.samsung.android.themestore, com.samsung.android.voc, com.samsung.sree, com.sec.android.app.camera, com.sec.android.app.clockpackage, com.sec.android.app.fm, com.sec.android.app.kidshome, com.sec.android.app.myfiles, com.sec.android.app.popupcalculator, com.sec.android.app.samsungapps, com.sec.android.app.sbrowser, com.sec.android.app.shealth, com.sec.android.app.voicenote, com.sec.android.gallery3d, com.sec.location.nfwlocationprivacy, com.sec.spp.push, com.spotify.music, fr.dvilleneuve.lockito, notion.id, uk.gov.tfl.cyclehire, za.co.thinkdigital.balwin, za.co.vodacom.android.app] 2023-01-27 17:19:11.398 8288-8311 GOS:DataUpdater pid-8288 I updatePackageList(), filtered pkgNameList, size: 51, [com.android.chrome, com.android.settings, com.android.traceur, com.android.vending, com.bgtest, com.breez.app, com.disneyplus.mea, com.facebook.katana, com.google.android.apps.docs, com.google.android.apps.maps, com.google.android.apps.messaging, com.google.android.apps.photos, com.google.android.apps.tachyon, com.google.android.apps.youtube.music, com.google.android.gm, com.google.android.googlequicksearchbox, com.google.android.videos, com.google.android.youtube, com.linkedin.android, com.microsoft.office.officehubrow, com.microsoft.office.outlook, com.microsoft.skydrive, com.netflix.mediaclient, com.samsung.accessibility, com.samsung.android.app.contacts, com.samsung.android.app.galaxyfinder, com.samsung.android.app.notes, com.samsung.android.app.watchmanagerstub, com.samsung.android.calendar, com.samsung.android.dialer, com.samsung.android.galaxy, com.samsung.android.lool, com.samsung.android.messaging, com.samsung.android.voc, com.samsung.sree, com.sec.android.app.camera, com.sec.android.app.clockpackage, com.sec.android.app.fm, com.sec.android.app.kidshome, com.sec.android.app.myfiles, com.sec.android.app.popupcalculator, com.sec.android.app.shealth, com.sec.android.app.voicenote, com.sec.android.gallery3d, com.sec.location.nfwlocationprivacy, com.spotify.music, fr.dvilleneuve.lockito, notion.id, uk.gov.tfl.cyclehire, za.co.thinkdigital.balwin, za.co.vodacom.android.app] 2023-01-27 17:19:11.400 8288-8311 GOS:NetworkConnector pid-8288 I getPkgList(), packageNameList: [com.android.chrome, com.android.settings, com.android.traceur, com.android.vending, com.bgtest, com.breez.app, com.disneyplus.mea, com.facebook.katana, com.google.android.apps.docs, com.google.android.apps.maps, com.google.android.apps.messaging, com.google.android.apps.photos, com.google.android.apps.tachyon, com.google.android.apps.youtube.music, com.google.android.gm, com.google.android.googlequicksearchbox, com.google.android.videos, com.google.android.youtube, com.linkedin.android, com.microsoft.office.officehubrow, com.microsoft.office.outlook, com.microsoft.skydrive, com.netflix.mediaclient, com.samsung.accessibility, com.samsung.android.app.contacts, com.samsung.android.app.galaxyfinder, com.samsung.android.app.notes, com.samsung.android.app.watchmanagerstub, com.samsung.android.calendar, com.samsung.android.dialer, com.samsung.android.galaxy, com.samsung.android.lool, com.samsung.android.messaging, com.samsung.android.voc, com.samsung.sree, com.sec.android.app.camera, com.sec.android.app.clockpackage, com.sec.android.app.fm, com.sec.android.app.kidshome, com.sec.android.app.myfiles, com.sec.android.app.popupcalculator, com.sec.android.app.shealth, com.sec.android.app.voicenote, com.sec.android.gallery3d, com.sec.location.nfwlocationprivacy, com.spotify.music, fr.dvilleneuve.lockito, notion.id, uk.gov.tfl.cyclehire, za.co.thinkdigital.balwin, za.co.vodacom.android.app] 2023-01-27 17:19:11.401 8288-8311 GOS:NetworkConnector pid-8288 I getPkgList(), tempTargetPkgNameList: [com.android.chrome, com.android.settings, com.android.traceur, com.android.vending, com.bgtest, com.breez.app, com.disneyplus.mea, com.facebook.katana, com.google.android.apps.docs, com.google.android.apps.maps, com.google.android.apps.messaging, com.google.android.apps.photos, com.google.android.apps.tachyon, com.google.android.apps.youtube.music, com.google.android.gm, com.google.android.googlequicksearchbox, com.google.android.videos, com.google.android.youtube, com.linkedin.android, com.microsoft.office.officehubrow, com.microsoft.office.outlook, com.microsoft.skydrive, com.netflix.mediaclient, com.samsung.accessibility, com.samsung.android.app.contacts, com.samsung.android.app.galaxyfinder, com.samsung.android.app.notes, com.samsung.android.app.watchmanagerstub, com.samsung.android.calendar, com.samsung.android.dialer, com.samsung.android.galaxy, com.samsung.android.lool, com.samsung.android.messaging, com.samsung.android.voc, com.samsung.sree, com.sec.android.app.camera, com.sec.android.app.clockpackage, com.sec.android.app.fm, com.sec.android.app.kidshome, com.sec.android.app.myfiles, com.sec.android.app.popupcalculator, com.sec.android.app.shealth, com.sec.android.app.voicenote, com.sec.android.gallery3d, com.sec.location.nfwlocationprivacy, com.spotify.music, fr.dvilleneuve.lockito, notion.id, uk.gov.tfl.cyclehire, za.co.thinkdigital.balwin, za.co.vodacom.android.app] 2023-01-27 17:19:12.435 8288-8311 GOS:NetworkConnector pid-8288 I doDirectly(), Response isSuccessful, responseCode: 200, URL: https://gos-api.gos-gsp.io/v4/packages?package_names=com.android.chrome%2Ccom.android.settings%2Ccom.android.traceur%2Ccom.android.vending%2Ccom.bgtest%2Ccom.breez.app%2Ccom.disneyplus.mea%2Ccom.facebook.katana%2Ccom.google.android.apps.docs%2Ccom.google.android.apps.maps%2Ccom.google.android.apps.messaging%2Ccom.google.android.apps.photos%2Ccom.google.android.apps.tachyon%2Ccom.google.android.apps.youtube.music%2Ccom.google.android.gm%2Ccom.google.android.googlequicksearchbox%2Ccom.google.android.videos%2Ccom.google.android.youtube%2Ccom.linkedin.android%2Ccom.microsoft.office.officehubrow%2Ccom.microsoft.office.outlook%2Ccom.microsoft.skydrive%2Ccom.netflix.mediaclient%2Ccom.samsung.accessibility%2Ccom.samsung.android.app.contacts%2Ccom.samsung.android.app.galaxyfinder%2Ccom.samsung.android.app.notes%2Ccom.samsung.android.app.watchmanagerstub%2Ccom.samsung.android.calendar%2Ccom.samsung.android.dialer%2Ccom.samsung.android.galaxy%2Ccom.samsung.android.lool%2Ccom.samsung.android.messaging%2Ccom.samsung.android.voc%2Ccom.samsung.sree%2Ccom.sec.android.app.camera%2Ccom.sec.android.app.clockpackage%2Ccom.sec.android.app.fm%2Ccom.sec.android.app.kidshome%2Ccom.sec.android.app.myfiles%2Ccom.sec.android.app.popupcalculator%2Ccom.sec.android.app.shealth%2Ccom.sec.android.app.voicenote%2Ccom.sec.android.gallery3d%2Ccom.sec.location.nfwlocationprivacy%2Ccom.spotify.music%2Cfr.dvilleneuve.lockito%2Cnotion.id%2Cuk.gov.tfl.cyclehire%2Cza.co.thinkdigital.balwin%2Cza.co.vodacom.android.app, response: [{"pkg_name":"com.sec.android.app.fm", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.googlequicksearchbox", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.galaxy", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.videos", "pkg_type":"non-game"}, {"pkg_name":"fr.dvilleneuve.lockito", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.voc", "pkg_type":"non-game"}, {"pkg_name":"com.linkedin.android", "pkg_type":"non-game"}, {"pkg_name":"com.android.traceur", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.popupcalculator", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.gm", "pkg_type":"non-game"}, {"pkg_name":"com.facebook.katana", "pkg_type":"non-game"}, {"pkg_name":"com.spotify.music", "pkg_type":"non-game"}, {"pkg_name":"com.android.chrome", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.youtube.music", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.camera", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.app.watchmanagerstub", "pkg_type":"non-game"}, {"pkg_name":"com.android.settings", "pkg_type":"non-game"}, {"pkg_name":"notion.id", "pkg_type":"non-game"}, {"pkg_name":"za.co.vodacom.android.app", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.lool", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.myfiles", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.shealth", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.youtube", "pkg_type":"non-game"}, {"pkg_name":"com.netflix.mediaclient", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.dialer", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.tachyon", "pkg_type":"non-game"}, {"pkg_name":"com.microsoft.office.officehubrow", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.voicenote", "pkg_type":"non-game"}, {"pkg_name":"com.bgtest", "pkg_type":"unknown"}, {"pkg_name":"com.sec.location.nfwlocationprivacy", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.clockpackage", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.app.contacts", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.photos", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.docs", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.messaging", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.calendar", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.app.notes", "pkg_type":"non-game"}, {"pkg_name":"com.android. 2023-01-27 17:19:12.436 8288-8311 GOS:NetworkConnector pid-8288 I v4GetPackages(), request: https://gos-api.gos-gsp.io/v4/packages?package_names=com.android.chrome%2Ccom.android.settings%2Ccom.android.traceur%2Ccom.android.vending%2Ccom.bgtest%2Ccom.breez.app%2Ccom.disneyplus.mea%2Ccom.facebook.katana%2Ccom.google.android.apps.docs%2Ccom.google.android.apps.maps%2Ccom.google.android.apps.messaging%2Ccom.google.android.apps.photos%2Ccom.google.android.apps.tachyon%2Ccom.google.android.apps.youtube.music%2Ccom.google.android.gm%2Ccom.google.android.googlequicksearchbox%2Ccom.google.android.videos%2Ccom.google.android.youtube%2Ccom.linkedin.android%2Ccom.microsoft.office.officehubrow%2Ccom.microsoft.office.outlook%2Ccom.microsoft.skydrive%2Ccom.netflix.mediaclient%2Ccom.samsung.accessibility%2Ccom.samsung.android.app.contacts%2Ccom.samsung.android.app.galaxyfinder%2Ccom.samsung.android.app.notes%2Ccom.samsung.android.app.watchmanagerstub%2Ccom.samsung.android.calendar%2Ccom.samsung.android.dialer%2Ccom.samsung.android.galaxy%2Ccom.samsung.android.lool%2Ccom.samsung.android.messaging%2Ccom.samsung.android.voc%2Ccom.samsung.sree%2Ccom.sec.android.app.camera%2Ccom.sec.android.app.clockpackage%2Ccom.sec.android.app.fm%2Ccom.sec.android.app.kidshome%2Ccom.sec.android.app.myfiles%2Ccom.sec.android.app.popupcalculator%2Ccom.sec.android.app.shealth%2Ccom.sec.android.app.voicenote%2Ccom.sec.android.gallery3d%2Ccom.sec.location.nfwlocationprivacy%2Ccom.spotify.music%2Cfr.dvilleneuve.lockito%2Cnotion.id%2Cuk.gov.tfl.cyclehire%2Cza.co.thinkdigital.balwin%2Cza.co.vodacom.android.app 2023-01-27 17:19:12.436 8288-8311 GOS:NetworkConnector pid-8288 I v4PkgResponse: [{"pkg_name":"com.sec.android.app.fm", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.googlequicksearchbox", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.galaxy", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.videos", "pkg_type":"non-game"}, {"pkg_name":"fr.dvilleneuve.lockito", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.voc", "pkg_type":"non-game"}, {"pkg_name":"com.linkedin.android", "pkg_type":"non-game"}, {"pkg_name":"com.android.traceur", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.popupcalculator", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.gm", "pkg_type":"non-game"}, {"pkg_name":"com.facebook.katana", "pkg_type":"non-game"}, {"pkg_name":"com.spotify.music", "pkg_type":"non-game"}, {"pkg_name":"com.android.chrome", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.youtube.music", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.camera", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.app.watchmanagerstub", "pkg_type":"non-game"}, {"pkg_name":"com.android.settings", "pkg_type":"non-game"}, {"pkg_name":"notion.id", "pkg_type":"non-game"}, {"pkg_name":"za.co.vodacom.android.app", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.lool", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.myfiles", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.shealth", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.youtube", "pkg_type":"non-game"}, {"pkg_name":"com.netflix.mediaclient", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.dialer", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.tachyon", "pkg_type":"non-game"}, {"pkg_name":"com.microsoft.office.officehubrow", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.voicenote", "pkg_type":"non-game"}, {"pkg_name":"com.bgtest", "pkg_type":"unknown"}, {"pkg_name":"com.sec.location.nfwlocationprivacy", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.clockpackage", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.app.contacts", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.photos", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.docs", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.messaging", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.calendar", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.app.notes", "pkg_type":"non-game"}, {"pkg_name":"com.android.vending", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.sree", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.kidshome", "pkg_type":"non-game"}, {"pkg_name":"com.breez.app", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.app.galaxyfinder", "pkg_type":"non-game"}, {"pkg_name":"com.microsoft.skydrive", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.messaging", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.gallery3d", "pkg_type":"non-game"}, {"pkg_name":"com.microsoft.office.outlook", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.accessibility", "pkg_type":"non-game"}, {"pkg_name":"com.disneyplus.mea", "pkg_type":"non-game"}, {"pkg_name":"uk.gov.tfl.cyclehire", "pkg_type":"non-game"}, {"pkg_name":"za.co.thinkdigital.balwin", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.maps", "pkg_type":"non-game"}] 2023-01-27 17:19:16.832 1315-1343 ActivityManager pid-1315 I Start proc 8925:com.bgtest/u0a239 for broadcast {com.bgtest/app.notifee.core.RebootBroadcastReceiver} 2023-01-27 17:19:16.853 8925-8925 com.bgtest pid-8925 I Late-enabling -Xcheck:jni 2023-01-27 17:19:17.039 8925-8925 USNET pid-8925 E USNET: appName: com.bgtest 2023-01-27 17:19:17.060 1315-2138 ActivityManager pid-1315 I DSS OFF for com.bgtest 2023-01-27 17:19:17.065 1315-2138 ActivityManager pid-1315 D attachApplicationLocked() app=ProcessRecord{f76177 8925:com.bgtest/u0a239} app.isolatedEntryPoint=null instr2=null 2023-01-27 17:19:17.084 8925-8925 ActivityThread pid-8925 D handleBindApplication()++ app=com.bgtest ---------------------------- PROCESS STARTED (8925) for package com.bgtest ---------------------------- 2023-01-27 17:19:17.108 8925-8925 ziparchive com.bgtest W Unable to open '/data/app/~~cDRyh8JxSiR4GzjgApJfjA==/com.bgtest-iYW5iqztO6_I28taX5v1PQ==/base.dm': No such file or directory 2023-01-27 17:19:17.108 8925-8925 ziparchive com.bgtest W Unable to open '/data/app/~~cDRyh8JxSiR4GzjgApJfjA==/com.bgtest-iYW5iqztO6_I28taX5v1PQ==/base.dm': No such file or directory 2023-01-27 17:19:17.506 8925-8925 nativeloader com.bgtest D Configuring classloader-namespace for other apk /data/app/cDRyh8JxSiR4GzjgApJfjA==/com.bgtest-iYW5iqztO6_I28taX5v1PQ==/base.apk. target_sdk_version=33, uses_libraries=, library_path=/data/app/cDRyh8JxSiR4GzjgApJfjA==/com.bgtest-iYW5iqztO6_I28taX5v1PQ==/lib/arm64:/data/app/~~cDRyh8JxSiR4GzjgApJfjA==/com.bgtest-iYW5iqztO6_I28taX5v1PQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.bgtest 2023-01-27 17:19:17.538 8925-8925 GraphicsEnvironment com.bgtest V ANGLE Developer option for 'com.bgtest' set to: 'default' 2023-01-27 17:19:17.538 8925-8925 GraphicsEnvironment com.bgtest V Neither updatable production driver nor prerelease driver is supported. 2023-01-27 17:19:17.546 8925-8925 LoadedApk com.bgtest D LoadedApk::makeApplication() appContext.mOpPackageName=com.bgtest appContext.mBasePackageName=com.bgtest 2023-01-27 17:19:17.546 8925-8925 NetworkSecurityConfig com.bgtest D No Network Security Config specified, using platform default 2023-01-27 17:19:17.592 8925-8925 NetworkSecurityConfig com.bgtest D No Network Security Config specified, using platform default 2023-01-27 17:19:17.614 8925-8925 WM-WrkMgrInitializer com.bgtest D Initializing WorkManager with default configuration. 2023-01-27 17:19:17.661 1315-1329 PackageManager pid-1315 D setEnabledSetting : userId = 0 packageName = com.bgtest cmp = androidx.work.impl.background.systemjob.SystemJobService newState = 1 callingPackage = 10239/com.bgtest 2023-01-27 17:19:17.707 8925-8925 NOTIFEE com.bgtest D (context): received application context 2023-01-27 17:19:17.735 8925-8925 ActivityThread com.bgtest D handleBindApplication() -- 2023-01-27 17:19:17.770 8925-8925 fb-UnpackingSoSource com.bgtest V locked dso store /data/user/0/com.bgtest/lib-main 2023-01-27 17:19:17.780 8925-8925 fb-UnpackingSoSource com.bgtest I dso store is up-to-date: /data/user/0/com.bgtest/lib-main 2023-01-27 17:19:17.780 8925-8925 fb-UnpackingSoSource com.bgtest V releasing dso store lock for /data/user/0/com.bgtest/lib-main 2023-01-27 17:19:17.796 8925-8952 Compatibil...geReporter com.bgtest D Compat change id reported: 160794467; UID 10239; state: ENABLED 2023-01-27 17:19:17.837 8925-8925 unknown:Re...gerBuilder com.bgtest W You're not setting the JS Engine Resolution Algorithm. We'll try to load JSC first, and if it fails we'll fallback to Hermes 2023-01-27 17:19:17.840 8925-8925 SoLoader com.bgtest V libjscexecutor.so not found on /data/data/com.bgtest/lib-main 2023-01-27 17:19:17.842 8925-8925 SoLoader com.bgtest V libjscexecutor.so not found on /data/app/~~cDRyh8JxSiR4GzjgApJfjA==/com.bgtest-iYW5iqztO6_I28taX5v1PQ==/lib/arm64 2023-01-27 17:19:17.842 8925-8925 SoLoader com.bgtest V libjscexecutor.so not found on /system/lib64 2023-01-27 17:19:17.843 8925-8925 SoLoader com.bgtest V libjscexecutor.so not found on /vendor/lib64 2023-01-27 17:19:17.850 8925-8925 SoLoader com.bgtest E couldn't find DSO to load: libjscexecutor.so SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/data/com.bgtest/lib-main flags = 1] SoSource 1: com.facebook.soloader.DirectorySoSource[root = /data/app/~~cDRyh8JxSiR4GzjgApJfjA==/com.bgtest-iYW5iqztO6_I28taX5v1PQ==/lib/arm64 flags = 0] SoSource 2: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2] SoSource 3: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2] Native lib dir: /data/app/~~cDRyh8JxSiR4GzjgApJfjA==/com.bgtest-iYW5iqztO6_I28taX5v1PQ==/lib/arm64 result: 0 2023-01-27 17:19:17.855 8925-8925 SoLoader com.bgtest V libhermes.so not found on /data/data/com.bgtest/lib-main 2023-01-27 17:19:17.856 8925-8925 SoLoader com.bgtest D libhermes.so found on /data/app/~~cDRyh8JxSiR4GzjgApJfjA==/com.bgtest-iYW5iqztO6_I28taX5v1PQ==/lib/arm64 2023-01-27 17:19:17.856 8925-8925 SoLoader com.bgtest D Not resolving dependencies for libhermes.so 2023-01-27 17:19:17.927 8925-8925 SoLoader com.bgtest V libhermes_executor.so not found on /data/data/com.bgtest/lib-main 2023-01-27 17:19:17.928 8925-8925 SoLoader com.bgtest D libhermes_executor.so found on /data/app/~~cDRyh8JxSiR4GzjgApJfjA==/com.bgtest-iYW5iqztO6_I28taX5v1PQ==/lib/arm64 2023-01-27 17:19:17.928 8925-8925 SoLoader com.bgtest D Not resolving dependencies for libhermes_executor.so 2023-01-27 17:19:18.503 8925-8925 SensorManager com.bgtest D registerListener :: 1, MC3419-P, 66667, 0, 2023-01-27 17:19:18.543 8925-8962 SoLoader com.bgtest V libfbjni.so not found on /data/data/com.bgtest/lib-main 2023-01-27 17:19:18.544 8925-8962 SoLoader com.bgtest D libfbjni.so found on /data/app/~~cDRyh8JxSiR4GzjgApJfjA==/com.bgtest-iYW5iqztO6_I28taX5v1PQ==/lib/arm64 2023-01-27 17:19:18.544 8925-8962 SoLoader com.bgtest D Not resolving dependencies for libfbjni.so 2023-01-27 17:19:18.548 8925-8962 SoLoader com.bgtest V libflipper.so not found on /data/data/com.bgtest/lib-main 2023-01-27 17:19:18.549 8925-8962 SoLoader com.bgtest D libflipper.so found on /data/app/~~cDRyh8JxSiR4GzjgApJfjA==/com.bgtest-iYW5iqztO6_I28taX5v1PQ==/lib/arm64 2023-01-27 17:19:18.549 8925-8962 SoLoader com.bgtest D Not resolving dependencies for libflipper.so 2023-01-27 17:19:18.616 8925-8964 unknown:In...Connection com.bgtest W Couldn't connect to packager, will silently retry 2023-01-27 17:19:18.691 8925-8925 com.bgtest com.bgtest W Accessing hidden field Landroid/view/View;->mKeyedTags:Landroid/util/SparseArray; (unsupported, reflection, allowed) 2023-01-27 17:19:18.692 8925-8925 com.bgtest com.bgtest W Accessing hidden field Landroid/view/View;->mListenerInfo:Landroid/view/View$ListenerInfo; (unsupported, reflection, allowed) 2023-01-27 17:19:18.692 8925-8925 com.bgtest com.bgtest W Accessing hidden field Landroid/view/View$ListenerInfo;->mOnClickListener:Landroid/view/View$OnClickListener; (unsupported, reflection, allowed) 2023-01-27 17:19:18.708 8925-8925 flipper com.bgtest I flipper: FlipperClient::addPlugin Inspector 2023-01-27 17:19:18.716 8925-8925 flipper com.bgtest I flipper: FlipperClient::addPlugin Databases 2023-01-27 17:19:18.724 8925-8925 flipper com.bgtest I flipper: FlipperClient::addPlugin Preferences 2023-01-27 17:19:18.725 8925-8925 flipper com.bgtest I flipper: FlipperClient::addPlugin CrashReporter 2023-01-27 17:19:18.734 8925-8925 flipper com.bgtest I flipper: FlipperClient::addPlugin Network 2023-01-27 17:19:18.742 8925-8925 RebootReceiver com.bgtest I Received reboot event 2023-01-27 17:19:18.746 8925-8925 NOTIFEE com.bgtest D (NotifeeAlarmManager): Reschedule Notifications on reboot 2023-01-27 17:19:18.790 8925-8925 TSBackgroundFetch com.bgtest D BootReceiver: android.intent.action.BOOT_COMPLETED 2023-01-27 17:19:18.797 8925-8961 System.err com.bgtest W SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 2023-01-27 17:19:18.797 8925-8961 System.err com.bgtest W SLF4J: Defaulting to no-operation (NOP) logger implementation 2023-01-27 17:19:18.797 8925-8961 System.err com.bgtest W SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 2023-01-27 17:19:18.805 8925-8925 TSBackgroundFetch com.bgtest D ☯️ onCreate 2023-01-27 17:19:18.855 8925-8925 TSBackgroundFetch com.bgtest D ☯️ HeadlessMode? true 2023-01-27 17:19:30.468 1315-1785 ActivityManager pid-1315 I Killing 8925:com.bgtest/u0a239 (adj 999): empty #21 ---------------------------- PROCESS ENDED (8925) for package com.bgtest ----------------------------

christocracy commented 1 year ago

Show me your package.json

MarkoVidalisBreez commented 1 year ago

This is the package.json for the new project - I have installed notifee since then but that hasn't changed any behaviour { "name": "bgtest", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest" }, "dependencies": { "@notifee/react-native": "^7.4.0", "react": "18.2.0", "react-native": "0.71.1", "react-native-background-fetch": "^4.1.8" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native-community/eslint-config": "^3.0.0", "@tsconfig/react-native": "^2.0.2", "@types/jest": "^29.2.1", "@types/react": "^18.0.24", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.2.1", "eslint": "^8.19.0", "jest": "^29.2.1", "metro-react-native-babel-preset": "0.73.7", "prettier": "^2.4.1", "react-test-renderer": "18.2.0", "typescript": "4.8.4" }, "jest": { "preset": "react-native" } }

And this is my main app's package.json

{ "name": "breez", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "androiddev": "react-native run-android --variant=debug", "androidprod": "react-native run-android --variant=release", "ios": "react-native run-ios", "iosdev": "react-native run-ios --device 'Marko' --scheme 'Breez (Dev)'", "iosproddebug": "react-native run-ios --device 'Marko' --scheme 'Breez (Prod Debug)'", "iosdevemulator": "react-native run-ios --scheme 'Breez (Dev)'", "iosprod": "react-native run-ios --device 'Marko'", "iosprodemulator": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "@bam.tech/react-native-image-resizer": "^3.0.4", "@google-cloud/storage": "^6.9.0", "@invertase/react-native-apple-authentication": "^2.2.2", "@notifee/react-native": "^7.4.0", "@react-native-async-storage/async-storage": "^1.17.7", "@react-native-community/datetimepicker": "^6.2.0", "@react-native-community/slider": "^4.3.2", "@react-native-firebase/analytics": "16.2.0", "@react-native-firebase/app": "16.2.0", "@react-native-firebase/app-check": "16.2.0", "@react-native-firebase/auth": "16.2.0", "@react-native-firebase/crashlytics": "16.2.0", "@react-native-firebase/firestore": "16.2.0", "@react-native-firebase/functions": "16.2.0", "@react-native-firebase/messaging": "^16.2.0", "@react-native-firebase/remote-config": "16.2.0", "@react-native-firebase/storage": "16.2.0", "@react-native-google-signin/google-signin": "^8.0.0", "@react-navigation/bottom-tabs": "^6.3.1", "@react-navigation/native": "^6.0.10", "@react-navigation/native-stack": "^6.6.2", "@rneui/base": "^4.0.0-rc.7", "@rneui/themed": "^4.0.0-rc.7", "@stripe/stripe-react-native": "^0.21.0", "@types/luxon": "^3.0.0", "@types/node": "^18.0.0", "@types/react-native": "^0.69.1", "autoprefixer": "^10.4.8", "axios": "^0.27.2", "country-flag-emoji": "^1.0.3", "crypto": "^1.0.1", "jsc-android": "^250230.2.1", "lottie-ios": "3.4.0", "lottie-react-native": "^5.1.3", "luxon": "^3.0.1", "moment": "^2.29.4", "postcss": "^8.4.16", "react": "17.0.2", "react-dom": "^18.2.0", "react-native": "0.68.5", "react-native-activity-recognition-wrapper": "1.2.0", "react-native-background-actions": "^2.6.8", "react-native-background-fetch": "^4.1.8", "react-native-background-timer": "^2.4.1", "react-native-circular-progress-indicator": "^4.4.0", "react-native-config": "^1.4.11", "react-native-contacts": "^7.0.5", "react-native-device-info": "^10.0.2", "react-native-dropdown-picker": "^5.4.2", "react-native-elements": "^3.4.2", "react-native-flash-message": "^0.2.1", "react-native-fs": "^2.20.0", "react-native-gesture-handler": "^2.5.0", "react-native-iap": "12.4.3", "react-native-image-crop-picker": "^0.39.0", "react-native-image-cropper": "^0.4.5", "react-native-inappbrowser-reborn": "^3.7.0", "react-native-indicators": "^0.17.0", "react-native-insta-story": "^1.1.8", "react-native-keyboard-aware-scroll-view": "^0.9.5", "react-native-localize": "^2.2.3", "react-native-maps": "^1.3.2", "react-native-modal": "^13.0.1", "react-native-notifications": "^4.3.1", "react-native-paper": "^4.12.5", "react-native-permissions": "^3.6.0", "react-native-phone-number-input": "^2.1.0", "react-native-reanimated": "^2.12.0", "react-native-responsive-fontsize": "^0.5.1", "react-native-responsive-screen": "^1.4.2", "react-native-safe-area-context": "^4.3.1", "react-native-screens": "^3.14.0", "react-native-searchable-dropdown": "^1.1.3", "react-native-svg": "^12.3.0", "react-native-toast-message": "^2.1.5", "react-native-vector-icons": "^9.2.0", "react-native-zip-archive": "^6.0.8", "react-query": "^3.39.1", "tailwindcss": "^3.1.8", "twrnc": "^3.3.3", "typescript": "^4.7.4", "zustand": "^4.0.0-rc.1" }, "devDependencies": { "@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.6.3", "eslint": "^7.32.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.67.0", "react-test-renderer": "17.0.2" }, "jest": { "preset": "react-native" } }

christocracy commented 1 year ago

System.err com.bgtest W SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

You seem to have an error related to SLF4J (an Android logging component). background-fetch does not use SLF4J. One of your other components must be at fault.

MarkoVidalisBreez commented 1 year ago

Thank you for your response, I'm looking into this and will let you know what happens ASAP!

MarkoVidalisBreez commented 1 year ago

I have resolved the SLF4J issue and the issue still persists. I also noticed I had a SOLoader error in the logs but I've also fixed that and the issue is still the same.

Here are the logs now on reboot:

--------- beginning of main --------- beginning of system 2023-01-28 09:10:53.788 1316-1316 OverlayManager pid-1316 D -> Updating overlay: target=com.bgtest overlays=[OverlayPaths { resourceDirs = [], overlayPaths = [] }] userId=0 2023-01-28 09:10:57.535 1316-1316 MultiUserInstallPolicy pid-1316 I applyInstallPolicyPackageInternalLPw : com.bgtest 2023-01-28 09:11:00.932 1316-1316 StorageManagerService pid-1316 V Package com.bgtest does not have legacy storage 2023-01-28 09:11:18.550 1316-1594 SGM:GameManager pid-1316 D identifyGamePackage. com.bgtest, mCurrentUserId: 0, callerUserId: 0, callingMethodInfo: com.samsung.android.game.SemGameManager.isGamePackage(SemGameManager.java:104) 2023-01-28 09:11:18.550 1316-1594 SGM:PkgDataHelper pid-1316 D getGamePkgData(). com.bgtest 2023-01-28 09:11:18.550 1316-1594 SGM:SemGameManager pid-1316 D isGamePackage(), pkgName=com.bgtest, ret=false 2023-01-28 09:11:18.550 1316-1594 Pageboost pid-1316 I appinfo : com.bgtest 0 1 0 0 2023-01-28 09:11:18.712 1316-1594 Pageboost pid-1316 I remove not installed app : com.bgtest 2023-01-28 09:13:45.167 2170-4657 ItemInfoUtils pid-2170 I createItemInfoFromLauncherApps: com.bgtest/null, UserHandle{0} 2023-01-28 09:13:45.695 2170-4657 ItemInfoUtils pid-2170 I createItemInfoFromLauncherApps: com.bgtest/null, UserHandle{0} 2023-01-28 09:13:46.674 1316-1594 SGM:GameManager pid-1316 D identifyGamePackage. com.bgtest, mCurrentUserId: 0, callerUserId: 0, callingMethodInfo: com.samsung.android.game.SemGameManager.isGamePackage(SemGameManager.java:104) 2023-01-28 09:13:46.674 1316-1594 SGM:PkgDataHelper pid-1316 D getGamePkgData(). com.bgtest 2023-01-28 09:13:46.674 1316-1594 SGM:SemGameManager pid-1316 D isGamePackage(), pkgName=com.bgtest, ret=false 2023-01-28 09:13:46.674 1316-1594 Pageboost pid-1316 I appinfo : com.bgtest 0 1 0 0 2023-01-28 09:13:47.288 1316-1594 Pageboost pid-1316 I pkg info : com.bgtest 2023-01-28 09:13:47.288 1316-1594 Pageboost pid-1316 I Reuse the dbinfo for this app info : com.bgtest /data/app/~~sIMOSt2d4VYj4H-R5muyjg==/com.bgtest-v97FoPugjZja5LQkogHTZQ==/base.apk 2023-01-28 09:13:47.298 2170-2315 HsWidgetPr...UpdateTask pid-2170 I 1. Predicted target com.bgtest#UserHandle{0} 2023-01-28 09:13:47.300 2170-2315 HsWidgetPr...UpdateTask pid-2170 I 1. Predicted target com.bgtest#UserHandle{0} 2023-01-28 09:13:48.068 2170-2315 AppIconSolution pid-2170 I getThemeIconWithBG called with public API, pkg = com.bgtest 2023-01-28 09:13:48.069 2170-2315 AppIconSolution pid-2170 I start to load, pkg=com.bgtest, bg=192-192, dr=144-144, forDefault=true, density=480 2023-01-28 09:13:48.071 2170-2315 AppIconSolution pid-2170 I getIconScale, pkg=com.bgtest, size=144, iconScale=IconScale[alpha=15, scale=1.0, isCrop=true] 2023-01-28 09:13:48.077 2170-2315 AppIconSolution pid-2170 I default container[CROP], pkg=com.bgtest, bg=114-114, dr=144-144, isNight = true 2023-01-28 09:13:48.096 2170-2315 LauncherActivityInfo pid-2170 I packageName: com.bgtest, useThemeIcon: false, height: 114, width: 114, density: 480 2023-01-28 09:14:25.898 1316-1329 SGM:GameManager pid-1316 D identifyGamePackage. com.bgtest, mCurrentUserId: 0, callerUserId: 0, callingMethodInfo: com.samsung.android.game.IGameManagerService$Stub.onTransact(IGameManagerService.java:242) 2023-01-28 09:14:25.898 1316-1329 SGM:PkgDataHelper pid-1316 D getGamePkgData(). com.bgtest 2023-01-28 09:14:25.899 8367-8403 DWBAndroidPackageCatego pid-8367 I com.bgtest was identified to Other(-1) 2023-01-28 09:14:25.900 8367-8403 DWBDbPackageCategorySou pid-8367 I update database cache to add com.bgtest as 'Other' 2023-01-28 09:14:26.554 8406-8430 GOS:DataUpdater pid-8406 I updatePackageList(), src pkgNameList, size: 71, [android.autoinstalls.config.samsung, com.android.chrome, com.android.settings, com.android.traceur, com.android.vending, com.aura.oobe.samsung.gl, com.bgtest, com.breez.app, com.disneyplus.mea, com.facebook.katana, com.google.android.apps.carrier.carrierwifi, com.google.android.apps.docs, com.google.android.apps.maps, com.google.android.apps.messaging, com.google.android.apps.photos, com.google.android.apps.restore, com.google.android.apps.tachyon, com.google.android.apps.turbo, com.google.android.apps.youtube.music, com.google.android.captiveportallogin, com.google.android.documentsui, com.google.android.gm, com.google.android.gms, com.google.android.googlequicksearchbox, com.google.android.ims, com.google.android.modulemetadata, com.google.android.networkstack, com.google.android.projection.gearhead, com.google.android.trichromelibrary, com.google.android.tts, com.google.android.videos, com.google.android.webview, com.google.android.youtube, com.google.mainline.telemetry, com.linkedin.android, com.microsoft.office.officehubrow, com.microsoft.office.outlook, com.microsoft.skydrive, com.netflix.mediaclient, com.samsung.accessibility, com.samsung.android.app.contacts, com.samsung.android.app.galaxyfinder, com.samsung.android.app.notes, com.samsung.android.app.watchmanagerstub, com.samsung.android.calendar, com.samsung.android.dialer, com.samsung.android.galaxy, com.samsung.android.lool, com.samsung.android.messaging, com.samsung.android.themestore, com.samsung.android.voc, com.samsung.sree, com.sec.android.app.camera, com.sec.android.app.clockpackage, com.sec.android.app.fm, com.sec.android.app.kidshome, com.sec.android.app.myfiles, com.sec.android.app.popupcalculator, com.sec.android.app.samsungapps, com.sec.android.app.sbrowser, com.sec.android.app.shealth, com.sec.android.app.voicenote, com.sec.android.gallery3d, com.sec.location.nfwlocationprivacy, com.sec.spp.push, com.spotify.music, fr.dvilleneuve.lockito, notion.id, uk.gov.tfl.cyclehire, za.co.thinkdigital.balwin, za.co.vodacom.android.app] 2023-01-28 09:14:26.857 8406-8430 GOS:DataUpdater pid-8406 I updatePackageList(), filtered pkgNameList, size: 51, [com.android.chrome, com.android.settings, com.android.traceur, com.android.vending, com.bgtest, com.breez.app, com.disneyplus.mea, com.facebook.katana, com.google.android.apps.docs, com.google.android.apps.maps, com.google.android.apps.messaging, com.google.android.apps.photos, com.google.android.apps.tachyon, com.google.android.apps.youtube.music, com.google.android.gm, com.google.android.googlequicksearchbox, com.google.android.videos, com.google.android.youtube, com.linkedin.android, com.microsoft.office.officehubrow, com.microsoft.office.outlook, com.microsoft.skydrive, com.netflix.mediaclient, com.samsung.accessibility, com.samsung.android.app.contacts, com.samsung.android.app.galaxyfinder, com.samsung.android.app.notes, com.samsung.android.app.watchmanagerstub, com.samsung.android.calendar, com.samsung.android.dialer, com.samsung.android.galaxy, com.samsung.android.lool, com.samsung.android.messaging, com.samsung.android.voc, com.samsung.sree, com.sec.android.app.camera, com.sec.android.app.clockpackage, com.sec.android.app.fm, com.sec.android.app.kidshome, com.sec.android.app.myfiles, com.sec.android.app.popupcalculator, com.sec.android.app.shealth, com.sec.android.app.voicenote, com.sec.android.gallery3d, com.sec.location.nfwlocationprivacy, com.spotify.music, fr.dvilleneuve.lockito, notion.id, uk.gov.tfl.cyclehire, za.co.thinkdigital.balwin, za.co.vodacom.android.app] 2023-01-28 09:14:26.860 8406-8430 GOS:NetworkConnector pid-8406 I getPkgList(), packageNameList: [com.android.chrome, com.android.settings, com.android.traceur, com.android.vending, com.bgtest, com.breez.app, com.disneyplus.mea, com.facebook.katana, com.google.android.apps.docs, com.google.android.apps.maps, com.google.android.apps.messaging, com.google.android.apps.photos, com.google.android.apps.tachyon, com.google.android.apps.youtube.music, com.google.android.gm, com.google.android.googlequicksearchbox, com.google.android.videos, com.google.android.youtube, com.linkedin.android, com.microsoft.office.officehubrow, com.microsoft.office.outlook, com.microsoft.skydrive, com.netflix.mediaclient, com.samsung.accessibility, com.samsung.android.app.contacts, com.samsung.android.app.galaxyfinder, com.samsung.android.app.notes, com.samsung.android.app.watchmanagerstub, com.samsung.android.calendar, com.samsung.android.dialer, com.samsung.android.galaxy, com.samsung.android.lool, com.samsung.android.messaging, com.samsung.android.voc, com.samsung.sree, com.sec.android.app.camera, com.sec.android.app.clockpackage, com.sec.android.app.fm, com.sec.android.app.kidshome, com.sec.android.app.myfiles, com.sec.android.app.popupcalculator, com.sec.android.app.shealth, com.sec.android.app.voicenote, com.sec.android.gallery3d, com.sec.location.nfwlocationprivacy, com.spotify.music, fr.dvilleneuve.lockito, notion.id, uk.gov.tfl.cyclehire, za.co.thinkdigital.balwin, za.co.vodacom.android.app] 2023-01-28 09:14:26.860 8406-8430 GOS:NetworkConnector pid-8406 I getPkgList(), tempTargetPkgNameList: [com.android.chrome, com.android.settings, com.android.traceur, com.android.vending, com.bgtest, com.breez.app, com.disneyplus.mea, com.facebook.katana, com.google.android.apps.docs, com.google.android.apps.maps, com.google.android.apps.messaging, com.google.android.apps.photos, com.google.android.apps.tachyon, com.google.android.apps.youtube.music, com.google.android.gm, com.google.android.googlequicksearchbox, com.google.android.videos, com.google.android.youtube, com.linkedin.android, com.microsoft.office.officehubrow, com.microsoft.office.outlook, com.microsoft.skydrive, com.netflix.mediaclient, com.samsung.accessibility, com.samsung.android.app.contacts, com.samsung.android.app.galaxyfinder, com.samsung.android.app.notes, com.samsung.android.app.watchmanagerstub, com.samsung.android.calendar, com.samsung.android.dialer, com.samsung.android.galaxy, com.samsung.android.lool, com.samsung.android.messaging, com.samsung.android.voc, com.samsung.sree, com.sec.android.app.camera, com.sec.android.app.clockpackage, com.sec.android.app.fm, com.sec.android.app.kidshome, com.sec.android.app.myfiles, com.sec.android.app.popupcalculator, com.sec.android.app.shealth, com.sec.android.app.voicenote, com.sec.android.gallery3d, com.sec.location.nfwlocationprivacy, com.spotify.music, fr.dvilleneuve.lockito, notion.id, uk.gov.tfl.cyclehire, za.co.thinkdigital.balwin, za.co.vodacom.android.app] 2023-01-28 09:14:27.854 8406-8430 GOS:NetworkConnector pid-8406 I doDirectly(), Response isSuccessful, responseCode: 200, URL: https://gos-api.gos-gsp.io/v4/packages?package_names=com.android.chrome%2Ccom.android.settings%2Ccom.android.traceur%2Ccom.android.vending%2Ccom.bgtest%2Ccom.breez.app%2Ccom.disneyplus.mea%2Ccom.facebook.katana%2Ccom.google.android.apps.docs%2Ccom.google.android.apps.maps%2Ccom.google.android.apps.messaging%2Ccom.google.android.apps.photos%2Ccom.google.android.apps.tachyon%2Ccom.google.android.apps.youtube.music%2Ccom.google.android.gm%2Ccom.google.android.googlequicksearchbox%2Ccom.google.android.videos%2Ccom.google.android.youtube%2Ccom.linkedin.android%2Ccom.microsoft.office.officehubrow%2Ccom.microsoft.office.outlook%2Ccom.microsoft.skydrive%2Ccom.netflix.mediaclient%2Ccom.samsung.accessibility%2Ccom.samsung.android.app.contacts%2Ccom.samsung.android.app.galaxyfinder%2Ccom.samsung.android.app.notes%2Ccom.samsung.android.app.watchmanagerstub%2Ccom.samsung.android.calendar%2Ccom.samsung.android.dialer%2Ccom.samsung.android.galaxy%2Ccom.samsung.android.lool%2Ccom.samsung.android.messaging%2Ccom.samsung.android.voc%2Ccom.samsung.sree%2Ccom.sec.android.app.camera%2Ccom.sec.android.app.clockpackage%2Ccom.sec.android.app.fm%2Ccom.sec.android.app.kidshome%2Ccom.sec.android.app.myfiles%2Ccom.sec.android.app.popupcalculator%2Ccom.sec.android.app.shealth%2Ccom.sec.android.app.voicenote%2Ccom.sec.android.gallery3d%2Ccom.sec.location.nfwlocationprivacy%2Ccom.spotify.music%2Cfr.dvilleneuve.lockito%2Cnotion.id%2Cuk.gov.tfl.cyclehire%2Cza.co.thinkdigital.balwin%2Cza.co.vodacom.android.app, response: [{"pkg_name":"com.sec.android.app.fm", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.googlequicksearchbox", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.galaxy", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.videos", "pkg_type":"non-game"}, {"pkg_name":"fr.dvilleneuve.lockito", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.voc", "pkg_type":"non-game"}, {"pkg_name":"com.linkedin.android", "pkg_type":"non-game"}, {"pkg_name":"com.android.traceur", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.popupcalculator", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.gm", "pkg_type":"non-game"}, {"pkg_name":"com.facebook.katana", "pkg_type":"non-game"}, {"pkg_name":"com.spotify.music", "pkg_type":"non-game"}, {"pkg_name":"com.android.chrome", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.youtube.music", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.camera", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.app.watchmanagerstub", "pkg_type":"non-game"}, {"pkg_name":"com.android.settings", "pkg_type":"non-game"}, {"pkg_name":"notion.id", "pkg_type":"non-game"}, {"pkg_name":"za.co.vodacom.android.app", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.lool", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.myfiles", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.shealth", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.youtube", "pkg_type":"non-game"}, {"pkg_name":"com.netflix.mediaclient", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.dialer", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.tachyon", "pkg_type":"non-game"}, {"pkg_name":"com.microsoft.office.officehubrow", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.voicenote", "pkg_type":"non-game"}, {"pkg_name":"com.bgtest", "pkg_type":"unknown"}, {"pkg_name":"com.sec.location.nfwlocationprivacy", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.clockpackage", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.app.contacts", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.photos", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.docs", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.messaging", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.calendar", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.app.notes", "pkg_type":"non-game"}, {"pkg_name":"com.android. 2023-01-28 09:14:27.855 8406-8430 GOS:NetworkConnector pid-8406 I v4GetPackages(), request: https://gos-api.gos-gsp.io/v4/packages?package_names=com.android.chrome%2Ccom.android.settings%2Ccom.android.traceur%2Ccom.android.vending%2Ccom.bgtest%2Ccom.breez.app%2Ccom.disneyplus.mea%2Ccom.facebook.katana%2Ccom.google.android.apps.docs%2Ccom.google.android.apps.maps%2Ccom.google.android.apps.messaging%2Ccom.google.android.apps.photos%2Ccom.google.android.apps.tachyon%2Ccom.google.android.apps.youtube.music%2Ccom.google.android.gm%2Ccom.google.android.googlequicksearchbox%2Ccom.google.android.videos%2Ccom.google.android.youtube%2Ccom.linkedin.android%2Ccom.microsoft.office.officehubrow%2Ccom.microsoft.office.outlook%2Ccom.microsoft.skydrive%2Ccom.netflix.mediaclient%2Ccom.samsung.accessibility%2Ccom.samsung.android.app.contacts%2Ccom.samsung.android.app.galaxyfinder%2Ccom.samsung.android.app.notes%2Ccom.samsung.android.app.watchmanagerstub%2Ccom.samsung.android.calendar%2Ccom.samsung.android.dialer%2Ccom.samsung.android.galaxy%2Ccom.samsung.android.lool%2Ccom.samsung.android.messaging%2Ccom.samsung.android.voc%2Ccom.samsung.sree%2Ccom.sec.android.app.camera%2Ccom.sec.android.app.clockpackage%2Ccom.sec.android.app.fm%2Ccom.sec.android.app.kidshome%2Ccom.sec.android.app.myfiles%2Ccom.sec.android.app.popupcalculator%2Ccom.sec.android.app.shealth%2Ccom.sec.android.app.voicenote%2Ccom.sec.android.gallery3d%2Ccom.sec.location.nfwlocationprivacy%2Ccom.spotify.music%2Cfr.dvilleneuve.lockito%2Cnotion.id%2Cuk.gov.tfl.cyclehire%2Cza.co.thinkdigital.balwin%2Cza.co.vodacom.android.app 2023-01-28 09:14:27.855 8406-8430 GOS:NetworkConnector pid-8406 I v4PkgResponse: [{"pkg_name":"com.sec.android.app.fm", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.googlequicksearchbox", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.galaxy", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.videos", "pkg_type":"non-game"}, {"pkg_name":"fr.dvilleneuve.lockito", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.voc", "pkg_type":"non-game"}, {"pkg_name":"com.linkedin.android", "pkg_type":"non-game"}, {"pkg_name":"com.android.traceur", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.popupcalculator", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.gm", "pkg_type":"non-game"}, {"pkg_name":"com.facebook.katana", "pkg_type":"non-game"}, {"pkg_name":"com.spotify.music", "pkg_type":"non-game"}, {"pkg_name":"com.android.chrome", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.youtube.music", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.camera", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.app.watchmanagerstub", "pkg_type":"non-game"}, {"pkg_name":"com.android.settings", "pkg_type":"non-game"}, {"pkg_name":"notion.id", "pkg_type":"non-game"}, {"pkg_name":"za.co.vodacom.android.app", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.lool", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.myfiles", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.shealth", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.youtube", "pkg_type":"non-game"}, {"pkg_name":"com.netflix.mediaclient", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.dialer", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.tachyon", "pkg_type":"non-game"}, {"pkg_name":"com.microsoft.office.officehubrow", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.voicenote", "pkg_type":"non-game"}, {"pkg_name":"com.bgtest", "pkg_type":"unknown"}, {"pkg_name":"com.sec.location.nfwlocationprivacy", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.clockpackage", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.app.contacts", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.photos", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.docs", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.messaging", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.calendar", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.app.notes", "pkg_type":"non-game"}, {"pkg_name":"com.android.vending", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.sree", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.app.kidshome", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.app.galaxyfinder", "pkg_type":"non-game"}, {"pkg_name":"com.microsoft.skydrive", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.android.messaging", "pkg_type":"non-game"}, {"pkg_name":"com.sec.android.gallery3d", "pkg_type":"non-game"}, {"pkg_name":"com.microsoft.office.outlook", "pkg_type":"non-game"}, {"pkg_name":"com.samsung.accessibility", "pkg_type":"non-game"}, {"pkg_name":"com.disneyplus.mea", "pkg_type":"non-game"}, {"pkg_name":"uk.gov.tfl.cyclehire", "pkg_type":"non-game"}, {"pkg_name":"za.co.thinkdigital.balwin", "pkg_type":"non-game"}, {"pkg_name":"com.google.android.apps.maps", "pkg_type":"non-game"}, {"pkg_name":"com.breez.app", "pkg_type":"non-game"}] 2023-01-28 09:14:32.372 1316-1343 ActivityManager pid-1316 I Start proc 9055:com.bgtest/u0a239 for broadcast {com.bgtest/com.transistorsoft.tsbackgroundfetch.BootReceiver} 2023-01-28 09:14:32.393 9055-9055 com.bgtest pid-9055 I Late-enabling -Xcheck:jni 2023-01-28 09:14:32.614 9055-9055 USNET pid-9055 E USNET: appName: com.bgtest 2023-01-28 09:14:32.645 1316-1329 ActivityManager pid-1316 I DSS OFF for com.bgtest 2023-01-28 09:14:32.654 1316-1329 ActivityManager pid-1316 D attachApplicationLocked() app=ProcessRecord{fd42ea7 9055:com.bgtest/u0a239} app.isolatedEntryPoint=null instr2=null 2023-01-28 09:14:32.674 9055-9055 ActivityThread pid-9055 D handleBindApplication()++ app=com.bgtest ---------------------------- PROCESS STARTED (9055) for package com.bgtest ---------------------------- 2023-01-28 09:14:32.677 9055-9055 Compatibil...geReporter com.bgtest D Compat change id reported: 171979766; UID 10239; state: ENABLED 2023-01-28 09:14:32.730 9055-9055 nativeloader com.bgtest D Configuring classloader-namespace for other apk /data/app/sIMOSt2d4VYj4H-R5muyjg==/com.bgtest-v97FoPugjZja5LQkogHTZQ==/base.apk. target_sdk_version=33, uses_libraries=, library_path=/data/app/sIMOSt2d4VYj4H-R5muyjg==/com.bgtest-v97FoPugjZja5LQkogHTZQ==/lib/arm64:/data/app/~~sIMOSt2d4VYj4H-R5muyjg==/com.bgtest-v97FoPugjZja5LQkogHTZQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.bgtest 2023-01-28 09:14:32.774 9055-9055 GraphicsEnvironment com.bgtest V ANGLE Developer option for 'com.bgtest' set to: 'default' 2023-01-28 09:14:32.775 9055-9055 GraphicsEnvironment com.bgtest V Neither updatable production driver nor prerelease driver is supported. 2023-01-28 09:14:32.782 9055-9055 LoadedApk com.bgtest D LoadedApk::makeApplication() appContext.mOpPackageName=com.bgtest appContext.mBasePackageName=com.bgtest 2023-01-28 09:14:32.782 9055-9055 NetworkSecurityConfig com.bgtest D No Network Security Config specified, using platform default 2023-01-28 09:14:32.832 9055-9055 NetworkSecurityConfig com.bgtest D No Network Security Config specified, using platform default 2023-01-28 09:14:32.869 9055-9055 ActivityThread com.bgtest D handleBindApplication() -- 2023-01-28 09:14:32.878 9055-9055 SoLoader com.bgtest V Init System Loader delegate 2023-01-28 09:14:32.905 9055-9055 unknown:Re...gerBuilder com.bgtest W You're not setting the JS Engine Resolution Algorithm. We'll try to load JSC first, and if it fails we'll fallback to Hermes 2023-01-28 09:14:33.387 9055-9055 SensorManager com.bgtest D registerListener :: 1, MC3419-P, 66667, 0, 2023-01-28 09:14:33.462 9055-9092 unknown:In...Connection com.bgtest W Couldn't connect to packager, will silently retry 2023-01-28 09:14:33.564 9055-9055 com.bgtest com.bgtest W Accessing hidden field Landroid/view/View;->mKeyedTags:Landroid/util/SparseArray; (unsupported, reflection, allowed) 2023-01-28 09:14:33.564 9055-9055 com.bgtest com.bgtest W Accessing hidden field Landroid/view/View;->mListenerInfo:Landroid/view/View$ListenerInfo; (unsupported, reflection, allowed) 2023-01-28 09:14:33.564 9055-9055 com.bgtest com.bgtest W Accessing hidden field Landroid/view/View$ListenerInfo;->mOnClickListener:Landroid/view/View$OnClickListener; (unsupported, reflection, allowed) 2023-01-28 09:14:33.577 9055-9055 flipper com.bgtest I flipper: FlipperClient::addPlugin Inspector 2023-01-28 09:14:33.582 9055-9055 flipper com.bgtest I flipper: FlipperClient::addPlugin Databases 2023-01-28 09:14:33.587 9055-9055 flipper com.bgtest I flipper: FlipperClient::addPlugin Preferences 2023-01-28 09:14:33.588 9055-9055 flipper com.bgtest I flipper: FlipperClient::addPlugin CrashReporter 2023-01-28 09:14:33.593 9055-9055 flipper com.bgtest I flipper: FlipperClient::addPlugin Network 2023-01-28 09:14:33.601 9055-9055 TSBackgroundFetch com.bgtest D BootReceiver: android.intent.action.BOOT_COMPLETED 2023-01-28 09:14:33.620 9055-9055 TSBackgroundFetch com.bgtest D ☯️ onCreate 2023-01-28 09:14:33.671 9055-9055 TSBackgroundFetch com.bgtest D ☯️ HeadlessMode? true 2023-01-28 09:14:45.558 1316-7429 ActivityManager pid-1316 I Killing 9055:com.bgtest/u0a239 (adj 999): empty #21 ---------------------------- PROCESS ENDED (9055) for package com.bgtest ----------------------------

christocracy commented 1 year ago

enableHeadless: false,

What are you expecting to happen when your device Is rebooted?

MarkoVidalisBreez commented 1 year ago

I am expecting it to run the event that is configured - but I am starting to understand that it doesn't run the job at that point, it only reschedules it according to the configuration that you've given it, is that correct? So on reboot it will not actually run the code yet. If it's configured to run every 15 minutes, then on reboot it will set that job up again, and it's first occurrence of executing the job will be 15 minutes later. Is my understanding correct?

christocracy commented 1 year ago

Show me the code you’re expecting to run when your app launches after device reboot with enableHeadless: false.

MarkoVidalisBreez commented 1 year ago

This is my index.js file


import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';
import BackgroundFetch from 'react-native-background-fetch';
import {
    enableActivityRecognitionTracking,
    startSignificantLocationUpdates,
} from 'react-native-activity-recognition-wrapper';

AppRegistry.registerComponent(appName, () => App);

const initBackgroundFetch = async () => {
        const onEvent = async (taskId) => {
            console.log('STARTING BG FETCH EVENT ' + taskId);

            await enableActivityRecognitionTracking(10, 10000, 100).then(async () => {
                console.log('BG FETCH EVENT EXECUTED: ' + taskId);
                return await startSignificantLocationUpdates();
            });
            BackgroundFetch.finish(taskId);
        };

        // Timeout callback is executed when your Task has exceeded its allowed running-time.
        // You must stop what you're doing immediately BackgroundFetch.finish(taskId)
        const onTimeout = async (taskId) => {
            console.warn('[BackgroundFetch] TIMEOUT task: ', taskId);
            BackgroundFetch.finish(taskId);
        };
        // Initialize BackgroundFetch only once when component mounts.
        const status = await BackgroundFetch.configure(
            {
                minimumFetchInterval: 15,
                startOnBoot: true,
                stopOnTerminate: false,
                enableHeadless: true,
                forceAlarmManager: true,
            },
            onEvent,
            onTimeout,
        ).then(status => {
            console.log('APPLICATION BG TASK REGISTERED SUCCESSFULLY');
            return status;
        });

        console.log('[BackgroundFetch] configure status: ', status);

};

initBackgroundFetch();
christocracy commented 1 year ago

That’s not how it works.

see api docs Config.enableHeadless.

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 6 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.