-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(file-chooser): add file chooser plugin support (#495)
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} |