@zenkit-dev/cordova-plugin-simple-chooser 2.0.1 → 2.0.2-dev.0

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/LICENSE CHANGED
@@ -1,3 +1,4 @@
1
+ Copyright (c) 2018, Cyph, Inc., Don Coleman, Ibby Hadeed, and Impossible
1
2
  Copyright (c) 2019, Zenkit
2
3
 
3
4
  Licensed under the Apache License, Version 2.0 (the "License");
package/README.md CHANGED
@@ -4,20 +4,20 @@
4
4
 
5
5
  A simple file chooser plugin for Cordova.
6
6
 
7
- Based on [`cordova-plugin-simple-chooser`](https://github.com/cyph/cordova-plugin-chooser),
7
+ Based on [`cordova-plugin-chooser`](https://github.com/cyph/cordova-plugin-chooser),
8
8
  but without using `Promise` and without loading the file `data` (can be done with `cordova-plugin-file`).
9
9
 
10
10
  Install with Cordova CLI:
11
11
 
12
12
  ```sh
13
- cordova plugin add https://github.com/zenkit/cordova-plugin-simple-chooser#v2.0.1
13
+ cordova plugin add @zenkit-dev/cordova-plugin-simple-chooser
14
14
  ```
15
15
 
16
16
  Supported Platforms:
17
17
 
18
- - Android
18
+ * Android
19
19
 
20
- - iOS
20
+ * iOS
21
21
 
22
22
  ## API
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenkit-dev/cordova-plugin-simple-chooser",
3
- "version": "2.0.1",
3
+ "version": "2.0.2-dev.0",
4
4
  "description": "A simple file chooser plugin for Cordova.",
5
5
  "repository": "https://github.com/zenkit/cordova-plugin-simple-chooser.git",
6
6
  "keywords": [
package/plugin.xml CHANGED
@@ -3,7 +3,7 @@
3
3
  xmlns="http://www.phonegap.com/ns/plugins/1.0"
4
4
  xmlns:android="http://schemas.android.com/apk/res/android"
5
5
  id="cordova-plugin-simple-chooser"
6
- version="2.0.1"
6
+ version="2.0.2-dev.0"
7
7
  >
8
8
  <name>Chooser</name>
9
9
  <author>Zenkit</author>
@@ -24,7 +24,6 @@
24
24
 
25
25
  <platform name="ios">
26
26
  <source-file src="src/ios/Chooser.swift" />
27
- <dependency id="cordova-plugin-add-swift-support" version="*" />
28
27
 
29
28
  <config-file target="config.xml" parent="/*">
30
29
  <feature name="Chooser">
@@ -6,11 +6,7 @@ import android.content.Intent;
6
6
  import android.database.Cursor;
7
7
  import android.net.Uri;
8
8
  import android.provider.MediaStore;
9
- import android.util.Base64;
10
9
 
11
- import java.io.ByteArrayOutputStream;
12
- import java.io.InputStream;
13
- import java.io.IOException;
14
10
  import java.lang.Exception;
15
11
 
16
12
  import org.apache.cordova.CallbackContext;
@@ -10,6 +10,7 @@ class Chooser : CDVPlugin {
10
10
  func callPicker (utis: [String]) {
11
11
  let picker = UIDocumentPickerViewController(documentTypes: utis, in: .import)
12
12
  picker.delegate = self
13
+ picker.presentationController?.delegate = self
13
14
  self.viewController.present(picker, animated: true, completion: nil)
14
15
  }
15
16
 
@@ -115,7 +116,7 @@ class Chooser : CDVPlugin {
115
116
  self.callPicker(utis: utis)
116
117
  }
117
118
 
118
- func send (_ message: String, _ status: CDVCommandStatus = CDVCommandStatus_OK) {
119
+ func send (_ message: String, _ status: CDVCommandStatus = .ok) {
119
120
  if let callbackId = self.commandCallback {
120
121
  self.commandCallback = nil
121
122
 
@@ -132,7 +133,7 @@ class Chooser : CDVPlugin {
132
133
  }
133
134
 
134
135
  func sendError (_ message: String) {
135
- self.send(message, CDVCommandStatus_ERROR)
136
+ self.send(message, .error)
136
137
  }
137
138
  }
138
139
 
@@ -158,3 +159,9 @@ extension Chooser : UIDocumentPickerDelegate {
158
159
  self.sendError("No File Selected")
159
160
  }
160
161
  }
162
+
163
+ extension Chooser : UIAdaptivePresentationControllerDelegate {
164
+ func presentationControllerDidDismiss(_ presentationController: UIPresentationController) {
165
+ self.sendError("No File Selected")
166
+ }
167
+ }