@hanwha-ss1/plugin 0.5.7 → 0.5.8
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.
|
@@ -17,27 +17,28 @@ public class DownloadPlugin: CAPPlugin {
|
|
|
17
17
|
if aData2.count > 1 {
|
|
18
18
|
let sData = aData2[1]
|
|
19
19
|
|
|
20
|
-
if
|
|
20
|
+
if Data(base64Encoded: sData, options: .ignoreUnknownCharacters) != nil {
|
|
21
21
|
let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
|
|
22
22
|
let documentsDirectory = paths[0]
|
|
23
23
|
let filePath = documentsDirectory.appendingPathComponent(fileName)
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"result": true,
|
|
31
|
-
])
|
|
32
|
-
}
|
|
33
|
-
} catch {
|
|
34
|
-
DispatchQueue.main.async {
|
|
25
|
+
let activityViewController = UIActivityViewController(activityItems: [filePath], applicationActivities: nil)
|
|
26
|
+
|
|
27
|
+
DispatchQueue.main.async {
|
|
28
|
+
if let topController = UIViewController.topViewController(controller: _bridge.viewController) {
|
|
29
|
+
topController.present(activityViewController, animated: true, completion: {
|
|
35
30
|
call.resolve([
|
|
36
|
-
"result":
|
|
31
|
+
"result": true
|
|
37
32
|
])
|
|
38
|
-
}
|
|
33
|
+
})
|
|
34
|
+
} else {
|
|
35
|
+
call.resolve([
|
|
36
|
+
"result": false,
|
|
37
|
+
])
|
|
39
38
|
}
|
|
40
39
|
}
|
|
40
|
+
|
|
41
|
+
|
|
41
42
|
} else {
|
|
42
43
|
DispatchQueue.main.async {
|
|
43
44
|
call.resolve([
|
|
@@ -48,5 +49,6 @@ public class DownloadPlugin: CAPPlugin {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
}
|
|
52
|
+
|
|
51
53
|
}
|
|
52
54
|
|