mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-22 18:46:26 +08:00
feat(file-chooser): add file chooser plugin support (#495)
This commit is contained in:
parent
4e9bc95fff
commit
94a7dae863
@ -42,6 +42,7 @@ import { EmailComposer } from './plugins/emailcomposer';
|
|||||||
import { EstimoteBeacons } from './plugins/estimote-beacons';
|
import { EstimoteBeacons } from './plugins/estimote-beacons';
|
||||||
import { Facebook } from './plugins/facebook';
|
import { Facebook } from './plugins/facebook';
|
||||||
import { File } from './plugins/file';
|
import { File } from './plugins/file';
|
||||||
|
import { FileChooser } from './plugins/file-chooser';
|
||||||
import { Transfer } from './plugins/filetransfer';
|
import { Transfer } from './plugins/filetransfer';
|
||||||
import { Flashlight } from './plugins/flashlight';
|
import { Flashlight } from './plugins/flashlight';
|
||||||
import { Geofence } from './plugins/geofence';
|
import { Geofence } from './plugins/geofence';
|
||||||
@ -172,6 +173,7 @@ Diagnostic,
|
|||||||
EmailComposer,
|
EmailComposer,
|
||||||
EstimoteBeacons,
|
EstimoteBeacons,
|
||||||
File,
|
File,
|
||||||
|
FileChooser,
|
||||||
Flashlight,
|
Flashlight,
|
||||||
Geofence,
|
Geofence,
|
||||||
Globalization,
|
Globalization,
|
||||||
@ -250,6 +252,7 @@ window['IonicNative'] = {
|
|||||||
EstimoteBeacons: EstimoteBeacons,
|
EstimoteBeacons: EstimoteBeacons,
|
||||||
Facebook: Facebook,
|
Facebook: Facebook,
|
||||||
File: File,
|
File: File,
|
||||||
|
FileChooser: FileChooser,
|
||||||
Flashlight: Flashlight,
|
Flashlight: Flashlight,
|
||||||
Geofence: Geofence,
|
Geofence: Geofence,
|
||||||
Geolocation: Geolocation,
|
Geolocation: Geolocation,
|
||||||
|
30
src/plugins/file-chooser.ts
Normal file
30
src/plugins/file-chooser.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import {Plugin, Cordova} from './plugin';
|
||||||
|
/**
|
||||||
|
* @name FileChooser
|
||||||
|
* @description
|
||||||
|
*
|
||||||
|
* Opens the file picker on Android for the user to select a file, returns a file URI.
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```
|
||||||
|
* import {FileChooser} from 'ionic-native';
|
||||||
|
*
|
||||||
|
* FileChooser.open()
|
||||||
|
* .then(uri => console.log(uri);
|
||||||
|
* .catch(e => console.log(e);
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
plugin: 'http://github.com/don/cordova-filechooser.git',
|
||||||
|
pluginRef: 'fileChooser',
|
||||||
|
repo: 'https://github.com/don/cordova-filechooser',
|
||||||
|
platforms: ['Android']
|
||||||
|
})
|
||||||
|
export class FileChooser {
|
||||||
|
/**
|
||||||
|
* Open a file
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
static open(): Promise<string> {return; }
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user