@kesha-antonov/react-native-background-downloader 4.6.1 โ 4.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -0
- package/android/build.gradle +7 -1
- package/package.json +29 -4
- package/ios/RNBackgroundDownloader.xcodeproj/project.xcworkspace/xcuserdata/kesha.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNBackgroundDownloader.xcodeproj/xcuserdata/kesha.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
package/README.md
CHANGED
|
@@ -20,6 +20,52 @@
|
|
|
20
20
|
Download and upload large files on iOS & Android โ even when your app is in the background or terminated by the OS.
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
|
+
<p align="center">
|
|
24
|
+
<strong><a href="https://kesha-antonov.github.io/react-native-background-downloader/">๐ Documentation</a></strong> ยท
|
|
25
|
+
<a href="https://kesha-antonov.github.io/react-native-background-downloader/installation">Installation</a> ยท
|
|
26
|
+
<a href="https://kesha-antonov.github.io/react-native-background-downloader/api">API reference</a> ยท
|
|
27
|
+
<a href="https://kesha-antonov.github.io/react-native-background-downloader/troubleshooting">Troubleshooting</a>
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
<p align="center">
|
|
31
|
+
<sub>Using it in production? A โญ helps other developers find the library.</sub>
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
<hr />
|
|
35
|
+
|
|
36
|
+
<table align="center">
|
|
37
|
+
<tr>
|
|
38
|
+
<td align="center" valign="top" width="190">
|
|
39
|
+
<a href="https://cryptoc-app.web.app/"><img src="https://cryptoc-app.web.app/img/icon.png?v=3" width="76" height="76" alt="cryptoc app icon" /></a>
|
|
40
|
+
<br /><br />
|
|
41
|
+
<img src="https://cryptoc-app.web.app/img/qr-get.png?v=2" width="124" height="124" alt="QR code that installs cryptoc" />
|
|
42
|
+
<br />
|
|
43
|
+
<sub>Scan to install</sub>
|
|
44
|
+
<br /><br />
|
|
45
|
+
<a href="https://apps.apple.com/app/cryptoc/id1333169178"><img height="40" src="https://cryptoc-app.web.app/img/appstore.svg?v=2" alt="Download on the App Store" /></a>
|
|
46
|
+
<br />
|
|
47
|
+
<a href="https://play.google.com/store/apps/details?id=co.ssoul.CryptoC"><img height="59" src="https://cryptoc-app.web.app/img/googleplay.png?v=2" alt="Get it on Google Play" /></a>
|
|
48
|
+
</td>
|
|
49
|
+
<td valign="top">
|
|
50
|
+
|
|
51
|
+
### Support my work
|
|
52
|
+
|
|
53
|
+
**[cryptoc](https://cryptoc-app.web.app/)** - my crypto portfolio app. Your coins on the home screen, lock screen and watch face. iPhone, iPad, Mac, Apple Watch, Android, Android tablet and Wear OS.
|
|
54
|
+
|
|
55
|
+
- Portfolio with average buy price and 24h / 180-day / all-time P&L
|
|
56
|
+
- Widgets in three sizes, refreshed in the background - most days you never open the app
|
|
57
|
+
- Price alerts on 5,000+ coins, delivered while the app is closed
|
|
58
|
+
- **No account, no email, no exchange API keys, no ads.** Your holdings never reach a server - they sync through your own iCloud or Google Drive
|
|
59
|
+
- Free for 3 holdings, and that is not a trial timer
|
|
60
|
+
|
|
61
|
+
<sub>Downloading it is what pays for the time that goes into these libraries.</sub>
|
|
62
|
+
|
|
63
|
+
</td>
|
|
64
|
+
</tr>
|
|
65
|
+
</table>
|
|
66
|
+
|
|
67
|
+
<hr />
|
|
68
|
+
|
|
23
69
|
---
|
|
24
70
|
|
|
25
71
|
## โจ Features
|
|
@@ -46,10 +92,41 @@
|
|
|
46
92
|
|
|
47
93
|
**This Library:** `@kesha-antonov/react-native-background-downloader` wraps these native APIs in a simple, unified JavaScript interface. Start a download, close your app, reopen it hours later, and seamlessly reconnect to your ongoing downloads with a single function call.
|
|
48
94
|
|
|
95
|
+
## โ๏ธ Comparison
|
|
96
|
+
|
|
97
|
+
How this library compares to other file transfer options in the React Native ecosystem:
|
|
98
|
+
|
|
99
|
+
| Capability | **This library** | `expo-file-system` | `react-native-blob-util` | `react-native-fs` |
|
|
100
|
+
|---|:--:|:--:|:--:|:--:|
|
|
101
|
+
| Background downloads on iOS | โ
| โ
<sup>1</sup> | โ | โ
<sup>4</sup> |
|
|
102
|
+
| Background downloads on Android | โ
| โ <sup>2</sup> | โ ๏ธ <sup>3</sup> | โ |
|
|
103
|
+
| Background uploads | โ
iOS + Android | โ ๏ธ iOS only | โ | โ |
|
|
104
|
+
| **Reconnect to transfers after app restart** | โ
| โ <sup>2</sup> | โ | โ |
|
|
105
|
+
| Pause / resume | โ
iOS + Android | โ ๏ธ iOS only | โ | โ ๏ธ iOS only <sup>5</sup> |
|
|
106
|
+
| Progress events | โ
| โ
| โ
| โ
|
|
|
107
|
+
| Expo config plugin | โ
| built in | โ | โ |
|
|
108
|
+
| New Architecture (TurboModules) | โ
| โ
| โ
| โ ๏ธ via community fork |
|
|
109
|
+
| General filesystem API | โ | โ
| โ
| โ
|
|
|
110
|
+
|
|
111
|
+
<sup>1</sup> Via `sessionType: 'background'` (iOS only).
|
|
112
|
+
|
|
113
|
+
<sup>2</sup> From the Expo docs: *"Android accepts this option for API consistency and ignores it"*, and *"the JavaScript `DownloadTask` instance is not restored if the app is terminated or relaunched, so its promise, progress callbacks, and cancellation state are only available while the original JS runtime is still alive."*
|
|
114
|
+
|
|
115
|
+
<sup>3</sup> Via `useDownloadManager: true`, which is `GET`-only and can only write to external storage.
|
|
116
|
+
|
|
117
|
+
<sup>4</sup> Via the `background: true` option (iOS only).
|
|
118
|
+
|
|
119
|
+
<sup>5</sup> Via the `resumable` callback (iOS only).
|
|
120
|
+
|
|
121
|
+
**The key difference is the highlighted row.** Several libraries can hand a transfer to the OS. This is the one that can find those transfers again after your app has been killed and relaunched - [`getExistingDownloadTasks()`](#re-attaching-to-background-tasks) returns live task objects you can re-bind your UI to, on both platforms.
|
|
122
|
+
|
|
123
|
+
**When you probably don't need this library:** if your files are small, or a failed transfer can simply be restarted from zero next time the user opens the app, `expo-file-system` is simpler and already in your project. Reach for this one when a transfer is long enough that losing it costs the user real time.
|
|
124
|
+
|
|
49
125
|
## ๐ Table of Contents
|
|
50
126
|
|
|
51
127
|
- [โจ Features](#-features)
|
|
52
128
|
- [๐ก Why?](#-why)
|
|
129
|
+
- [โ๏ธ Comparison](#๏ธ-comparison)
|
|
53
130
|
- [๐ Table of Contents](#-table-of-contents)
|
|
54
131
|
- [๐ Requirements](#-requirements)
|
|
55
132
|
- [๐ฆ Installation](#-installation)
|
|
@@ -1082,6 +1159,8 @@ Maintained by [Kesha Antonov](https://github.com/kesha-antonov)
|
|
|
1082
1159
|
|
|
1083
1160
|
Based on [react-native-background-downloader](https://github.com/ekolabs/react-native-background-downloader) by [Elad Gil](https://github.com/ptelad) (unmaintained since 2019)
|
|
1084
1161
|
|
|
1162
|
+
I also build **[cryptoc](https://cryptoc-app.web.app/)** - a crypto portfolio app with home screen, lock screen and Watch widgets, no account and no exchange API keys.
|
|
1163
|
+
|
|
1085
1164
|
> Please note that this project is maintained in free time. If you find it helpful, please consider [becoming a sponsor](https://github.com/sponsors/kesha-antonov).
|
|
1086
1165
|
|
|
1087
1166
|
## ๐ License
|
package/android/build.gradle
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
|
-
|
|
2
|
+
// AGP 9 ships built-in Kotlin support and registers the `kotlin` extension
|
|
3
|
+
// itself. Applying the Kotlin plugin on top of it fails configuration with
|
|
4
|
+
// "Cannot add extension with name 'kotlin'". Only apply it when nothing has
|
|
5
|
+
// registered that extension yet.
|
|
6
|
+
if (project.extensions.findByName('kotlin') == null) {
|
|
7
|
+
apply plugin: 'kotlin-android'
|
|
8
|
+
}
|
|
3
9
|
|
|
4
10
|
def isNewArchitectureEnabled() {
|
|
5
11
|
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
package/package.json
CHANGED
|
@@ -1,18 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kesha-antonov/react-native-background-downloader",
|
|
3
|
-
"version": "4.6.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.6.3",
|
|
4
|
+
"description": "Background file downloads and uploads for React Native and Expo. Large files keep transferring on iOS and Android while your app is in the background or terminated. Pause/resume, progress events, TurboModules, TypeScript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
7
|
+
"expo",
|
|
8
|
+
"expo-plugin",
|
|
7
9
|
"background",
|
|
10
|
+
"background-download",
|
|
11
|
+
"background-upload",
|
|
8
12
|
"download",
|
|
9
|
-
"
|
|
13
|
+
"downloader",
|
|
14
|
+
"upload",
|
|
15
|
+
"uploader",
|
|
16
|
+
"file-download",
|
|
17
|
+
"file-upload",
|
|
18
|
+
"file-transfer",
|
|
19
|
+
"large-files",
|
|
20
|
+
"resumable",
|
|
21
|
+
"resumable-download",
|
|
22
|
+
"pause-resume",
|
|
23
|
+
"progress",
|
|
24
|
+
"ios",
|
|
25
|
+
"android",
|
|
26
|
+
"nsurlsession",
|
|
27
|
+
"urlsession",
|
|
28
|
+
"downloadmanager",
|
|
29
|
+
"foreground-service",
|
|
30
|
+
"turbomodule",
|
|
31
|
+
"new-architecture",
|
|
32
|
+
"typescript",
|
|
33
|
+
"offline",
|
|
34
|
+
"offline-first"
|
|
10
35
|
],
|
|
11
36
|
"repository": {
|
|
12
37
|
"type": "git",
|
|
13
38
|
"url": "git+https://github.com/kesha-antonov/react-native-background-downloader.git"
|
|
14
39
|
},
|
|
15
|
-
"homepage": "https://
|
|
40
|
+
"homepage": "https://kesha-antonov.github.io/react-native-background-downloader/",
|
|
16
41
|
"license": "Apache-2.0",
|
|
17
42
|
"author": {
|
|
18
43
|
"name": "Kesha Antonov, Eko labs",
|
|
Binary file
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>SchemeUserState</key>
|
|
6
|
-
<dict>
|
|
7
|
-
<key>RNBackgroundDownloader.xcscheme_^#shared#^_</key>
|
|
8
|
-
<dict>
|
|
9
|
-
<key>orderHint</key>
|
|
10
|
-
<integer>0</integer>
|
|
11
|
-
</dict>
|
|
12
|
-
</dict>
|
|
13
|
-
</dict>
|
|
14
|
-
</plist>
|