@hanwha-ss1/plugin 0.5.6 → 0.5.7
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.
|
@@ -5,7 +5,7 @@ import Capacitor
|
|
|
5
5
|
public class DownloadPlugin: CAPPlugin {
|
|
6
6
|
|
|
7
7
|
@objc public func doDownload(_ call: CAPPluginCall, _bridge: CAPBridgeProtocol) {
|
|
8
|
-
let body = call.getString("
|
|
8
|
+
let body = call.getString("file") ?? ""
|
|
9
9
|
|
|
10
10
|
let aSplit = body.components(separatedBy: ";")
|
|
11
11
|
|
|
@@ -14,7 +14,9 @@ public class DownloadPlugin: CAPPlugin {
|
|
|
14
14
|
let sData1 = "\(aSplit[1])\(aSplit[2])"
|
|
15
15
|
let aData2 = sData1.components(separatedBy: ",")
|
|
16
16
|
|
|
17
|
-
if aData2.count > 1
|
|
17
|
+
if aData2.count > 1 {
|
|
18
|
+
let sData = aData2[1]
|
|
19
|
+
|
|
18
20
|
if let data = Data(base64Encoded: sData, options: .ignoreUnknownCharacters) {
|
|
19
21
|
let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
|
|
20
22
|
let documentsDirectory = paths[0]
|