Skip to content

Commit

Permalink
feat(file-chooser): add file chooser plugin support (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed committed Aug 27, 2016
1 parent 4e9bc95 commit 94a7dae
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { EmailComposer } from './plugins/emailcomposer';
import { EstimoteBeacons } from './plugins/estimote-beacons';
import { Facebook } from './plugins/facebook';
import { File } from './plugins/file';
import { FileChooser } from './plugins/file-chooser';
import { Transfer } from './plugins/filetransfer';
import { Flashlight } from './plugins/flashlight';
import { Geofence } from './plugins/geofence';
Expand Down Expand Up @@ -172,6 +173,7 @@ Diagnostic,
EmailComposer,
EstimoteBeacons,
File,
FileChooser,
Flashlight,
Geofence,
Globalization,
Expand Down Expand Up @@ -250,6 +252,7 @@ window['IonicNative'] = {
EstimoteBeacons: EstimoteBeacons,
Facebook: Facebook,
File: File,
FileChooser: FileChooser,
Flashlight: Flashlight,
Geofence: Geofence,
Geolocation: Geolocation,
Expand Down
30 changes: 30 additions & 0 deletions src/plugins/file-chooser.ts
Original file line number Diff line number Diff line change
@@ -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; }
}

0 comments on commit 94a7dae

Please sign in to comment.