Skip to content

Commit

Permalink
feat(plugin): add iOS File Picker
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsogl committed Mar 17, 2018
1 parent 1113bba commit 571df3a
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/@ionic-native/plugins/file-picker/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';

/**
* @name File Chooser
* @description
*
* Opens the file picker on iOS for the user to select a file, returns a file URI.
*
* @usage
* ```typescript
* import { IOSFilePicker } from '@ionic-native/file-picker';
*
* constructor(private filePicker: IOSFilePicker) { }
*
* ...
*
* this.filePicker.pickFile()
* .then(uri => console.log(uri))
* .catch(err => console.log('Error', err));
*
* ```
*/
@Plugin({
pluginName: 'iOS File Picker',
plugin: 'cordova-plugin-filepicker',
pluginRef: 'filePicker',
repo: 'https://github.com/jcesarmobile/FilePicker-Phonegap-iOS-Plugin',
platforms: ['iOS']
})
@Injectable()
export class IOSFilePicker extends IonicNativePlugin {
/**
* Open a file
* @returns {Promise<string>}
*/
@Cordova()
pickFile(): Promise<string> {
return;
}
}

0 comments on commit 571df3a

Please sign in to comment.