Open Diwei-Chen opened 5 years ago
We are having the same issue. @Diwei-Chen did you solve this satisfactorily? Could you share how?
Maintainers - would be good to include instructions for configuring this in Android > 8.1
AFAIK it should be enough to enable the notification, by setting options: { notification: { enabled: true ... }
when doing an upload
@NicholasIoanJones I am sorry to tell but without enough knowledge to help improve the Android code, we ended up with replacing this package with the fetch
method in rn-fetch-blob
in the sacrifice of background upload capability on Android.
I solved my problem adding this line
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
in my android manifest
Followed the solution as proposed in https://github.com/Vydia/react-native-background-upload/issues/59
After turning off the notification setting, now Android is throwing:
The
targetSdkVersion
in ourandroid/app/build.gradle
is 27 andcompileSdkVersion
is 28.We found some solutions on stack overflow https://stackoverflow.com/questions/47531742/startforeground-fail-after-upgrade-to-android-8-1 but not sure if we're doing the right thing.
Any ideas, please?
Related documentation: https://developer.android.com/reference/android/content/Context.html#startForegroundService(android.content.Intent)