Skip to content

Commit

Permalink
feat(ionic-webview): plugin for cordova-plugin-ionic-webview 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
imhoffd committed Jun 12, 2018
1 parent 6662234 commit 8beb177
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/@ionic-native/plugins/ionic-webview/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { Injectable } from '@angular/core';
import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';

/**
* @name Ionic Webview
* @description
* Access Web View utilities.
*
* Requires the Cordova plugin: `cordova-plugin-ionic-webview` > 2.0. For more info, please see the [Ionic Web View](https://github.com/ionic-team/cordova-plugin-ionic-webview) repository.
*
* @usage
* ```typescript
* import { WebView } from '@ionic-native/ionic-webview';
*
*
* constructor(private webview: WebView) { }
*
* ...
*
* img = this.webview.convertFileSrc('file:///Users/dan/camera-image-12345.png')
*
* ```
*/
@Plugin({
pluginName: 'WebView',
plugin: 'cordova-plugin-ionic-webview',
pluginRef: 'window.Ionic.WebView',
repo: 'https://github.com/ionic-team/cordova-plugin-ionic-webview',
platforms: ['Android', 'iOS'],
install: 'ionic cordova plugin add cordova-plugin-ionic-webview'
})
@Injectable()
export class WebView extends IonicNativePlugin {

/**
* Convert a `file://` URL to a URL that is compatible with the local web server in the Web View plugin.
*/
@CordovaProperty()
convertFileSrc: (url: string) => string;

}

0 comments on commit 8beb177

Please sign in to comment.