@capgo/capacitor-downloader 7.2.3 → 7.2.5
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
CHANGED
|
@@ -9,7 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
Download file in background or foreground
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## Why Capacitor Downloader?
|
|
13
|
+
|
|
14
|
+
A reliable **native file downloader** built for Capacitor apps that continues downloads even when your app is backgrounded or closed:
|
|
15
|
+
|
|
16
|
+
- **Background downloads** - Downloads continue even when app is minimized, backgrounded, or closed (main advantage)
|
|
17
|
+
- **Progress tracking** - Real-time progress updates during downloads
|
|
18
|
+
- **Network control** - Choose between WiFi-only or cellular network downloads
|
|
19
|
+
- **Custom headers** - Add authentication tokens and custom HTTP headers
|
|
20
|
+
- **Resumable downloads** - Pause and resume downloads (platform dependent)
|
|
21
|
+
- **Event listeners** - Monitor download progress, completion, and failures
|
|
22
|
+
- **Large file support** - Handle multi-gigabyte files without memory issues
|
|
23
|
+
- **Free and open source** - No paid services required
|
|
24
|
+
|
|
25
|
+
Perfect for downloading large media files, offline content, app updates, and any scenario where downloads need to survive app lifecycle events.
|
|
13
26
|
|
|
14
27
|
## Documentation
|
|
15
28
|
|
package/android/src/main/java/ee/forgr/capacitor/plugin/downloader/CapacitorDownloaderPlugin.java
CHANGED
|
@@ -22,7 +22,7 @@ import java.util.Map;
|
|
|
22
22
|
@CapacitorPlugin(name = "CapacitorDownloader")
|
|
23
23
|
public class CapacitorDownloaderPlugin extends Plugin {
|
|
24
24
|
|
|
25
|
-
private final String
|
|
25
|
+
private final String pluginVersion = "7.2.5";
|
|
26
26
|
|
|
27
27
|
private DownloadManager downloadManager;
|
|
28
28
|
private final Map<String, Long> downloads = new HashMap<>();
|
|
@@ -266,7 +266,7 @@ public class CapacitorDownloaderPlugin extends Plugin {
|
|
|
266
266
|
public void getPluginVersion(final PluginCall call) {
|
|
267
267
|
try {
|
|
268
268
|
final JSObject ret = new JSObject();
|
|
269
|
-
ret.put("version", this.
|
|
269
|
+
ret.put("version", this.pluginVersion);
|
|
270
270
|
call.resolve(ret);
|
|
271
271
|
} catch (final Exception e) {
|
|
272
272
|
call.reject("Could not get plugin version", e);
|
|
@@ -8,7 +8,7 @@ import Capacitor
|
|
|
8
8
|
|
|
9
9
|
@objc(CapacitorDownloaderPlugin)
|
|
10
10
|
public class CapacitorDownloaderPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
11
|
-
private let
|
|
11
|
+
private let pluginVersion: String = "7.2.5"
|
|
12
12
|
public let identifier = "CapacitorDownloaderPlugin"
|
|
13
13
|
public let jsName = "CapacitorDownloader"
|
|
14
14
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
@@ -177,7 +177,7 @@ extension CapacitorDownloaderPlugin: URLSessionDownloadDelegate {
|
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
@objc func getPluginVersion(_ call: CAPPluginCall) {
|
|
180
|
-
call.resolve(["version": self.
|
|
180
|
+
call.resolve(["version": self.pluginVersion])
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
}
|