react-native-background-actions icon indicating copy to clipboard operation
react-native-background-actions copied to clipboard

App not responding modal occurs in android 14.

Open myzow opened this issue 1 year ago • 5 comments

I am using react-native-geolocation-service to fetch location with Background actions . It is working fine in all other android versions but getting the "App not responding modal" in andorid 14 after some time. Untitled design Uploading Untitled design.png…

myzow avatar Oct 08 '24 05:10 myzow

same issue, did you find a solution?

carozo avatar Oct 21 '24 20:10 carozo

Any update, Facing same!

DevAsrar avatar Dec 05 '24 07:12 DevAsrar

We seem to be facing the same issue, any suggestions?

@myzow What did you conclude?

tmaly1980 avatar Dec 05 '24 15:12 tmaly1980

The problem I discovered is the service type set to "shortService" as recommended in this library's docs. The Android specs are here: https://developer.android.com/develop/background-work/services/fgs/service-types

The app will say "App is Not Responding" if the code runs for longer than 3 minutes. In my case, I have an infinite loop scanning an offline database to sync with the server periodically.

I switched the service type to "dataSync" and made modifications as recommended here: https://developer.android.com/develop/background-work/services/fgs/service-types#data-sync

Now it seems to work without limitations. Only issue I've read is Google will require a video showing the functionality.

tmaly1980 avatar Dec 09 '24 22:12 tmaly1980

I switched the service type to "dataSync" and made modifications as recommended here: https://developer.android.com/develop/background-work/services/fgs/service-types#data-sync

Can confirm it also worked for me by adding dataSync and <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/> 🥳

OB42 avatar Dec 25 '24 21:12 OB42