Skip to content
This repository was archived by the owner on Feb 27, 2022. It is now read-only.

Commit 0abe24a

Browse files
author
Tsirikoglou Yiannis
committed
Merge remote-tracking branch 'upstream/master' into master_copy
# Conflicts: # android/build.gradle # android/src/main/java/com/eko/RNBackgroundDownloaderModule.java
2 parents 7a9e99a + dc07f48 commit 0abe24a

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

android/build.gradle

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
apply plugin: 'com.android.library'
22

3+
def safeExtGet(prop, fallback) {
4+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
5+
}
6+
37
android {
4-
compileSdkVersion rootProject.ext.compileSdkVersion
5-
buildToolsVersion rootProject.ext.buildToolsVersion
8+
compileSdkVersion safeExtGet("compileSdkVersion", 28)
69

710
defaultConfig {
8-
minSdkVersion rootProject.ext.minSdkVersion
9-
targetSdkVersion rootProject.ext.targetSdkVersion
11+
minSdkVersion safeExtGet('minSdkVersion', 16)
12+
targetSdkVersion safeExtGet('targetSdkVersion', 28)
1013
versionCode 1
1114
versionName "1.0"
1215
ndk {
@@ -18,12 +21,11 @@ android {
1821
dependencies {
1922
//noinspection GradleDynamicVersion
2023
implementation 'com.facebook.react:react-native:+'
21-
if (project.properties['android.useAndroidX'] == true) {
22-
implementation "androidx.tonyodev.fetch2:xfetch2:3.1.4"
23-
implementation "androidx.tonyodev.fetch2okhttp:xfetch2okhttp:3.1.4"
24-
24+
if (project.properties['android.useAndroidX'] == 'true' || project.properties['android.useAndroidX'] == true) {
25+
api "androidx.tonyodev.fetch2:xfetch2:3.1.4"
26+
api "androidx.tonyodev.fetch2okhttp:xfetch2okhttp:3.1.4"
2527
} else {
26-
implementation "com.tonyodev.fetch2:fetch2:3.0.10"
27-
implementation "com.tonyodev.fetch2okhttp:fetch2okhttp:3.0.10"
28+
api "com.tonyodev.fetch2:fetch2:3.0.10"
29+
api "com.tonyodev.fetch2okhttp:fetch2okhttp:3.0.10"
2830
}
2931
}

android/src/main/java/com/eko/RNBackgroundDownloaderModule.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,9 @@ public void onCompleted(Download download) {
319319
}
320320

321321
removeFromMaps(download.getId());
322-
fetch.remove(download.getId());
322+
if (!fetch.isClosed()) {
323+
fetch.remove(download.getId());
324+
}
323325
}
324326
}
325327

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-background-downloader",
3-
"version": "2.3.1",
3+
"version": "2.3.4",
44
"description": "A library for React-Native to help you download large files on iOS and Android both in the foreground and most importantly in the background.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)