All Projects → kunder-lab → Cl.kunder.webview

kunder-lab / Cl.kunder.webview

Licence: apache-2.0
This cordova plugin enables you to open a second webview

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Cl.kunder.webview

ionic-native-sms-retriever-plugin-master
Cross-platform plugin for Cordova / PhoneGap to Retrieve SMS. Available for Android.
Stars: ✭ 16 (-55.56%)
Mutual labels:  cordova, cordova-plugin
Vue Cordova
Vue.js plugin for Cordova
Stars: ✭ 328 (+811.11%)
Mutual labels:  cordova, cordova-plugin
scanbot-sdk-example-ionic
Scanbot scanner SDK example app for Ionic with Cordova.
Stars: ✭ 24 (-33.33%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Permissionscope
🔓 Cordova plugin to handle iOS permissions
Stars: ✭ 27 (-25%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Camera Preview
Cordova plugin that allows camera interaction from HTML code
Stars: ✭ 528 (+1366.67%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-apkupdater
This plugin allows your Android app to download and install compressed updates without the Google Play Store.
Stars: ✭ 46 (+27.78%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Disable Bitcode
Cordova plugin to disable bitcode in iOS build settings
Stars: ✭ 19 (-47.22%)
Mutual labels:  cordova, cordova-plugin
cordova-swift3-plugin-example
Swift 3 Cordova plugin example to support blog post.
Stars: ✭ 23 (-36.11%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Admob Free
Cordova AdMob Plugin
Stars: ✭ 508 (+1311.11%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Qrscanner
A fast, energy efficient, highly-configurable QR code scanner for Cordova apps and the browser.
Stars: ✭ 485 (+1247.22%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-flurryanalytics
Adds support for all that Flurry Analytics flavored goodness to your Cordova based apps
Stars: ✭ 23 (-36.11%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Linkedin
Cordova plugin for LinkedIn
Stars: ✭ 17 (-52.78%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-dbcopy
Copy SQLite Database from www folder to default app database location
Stars: ✭ 90 (+150%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-today-widget
Add a today widget app extension target to your cordova project.
Stars: ✭ 51 (+41.67%)
Mutual labels:  cordova, cordova-plugin
example-cordova-code-push-plugin
Ionic + Cordova Code Push Plugin Example
Stars: ✭ 45 (+25%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Geofence
Geofencing plugin for cordova
Stars: ✭ 261 (+625%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-wkkeyboardfix
Cordova plugin to provide a temporary fix for an iOS 12 and 13 bug involving keyboards in WKWebView.
Stars: ✭ 14 (-61.11%)
Mutual labels:  cordova, cordova-plugin
cordova-support-google-services
DEPRECATED. Cordova plugin to add google services support
Stars: ✭ 41 (+13.89%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Ionic Webview
Web View plugin for Cordova, specialized for Ionic apps.
Stars: ✭ 419 (+1063.89%)
Mutual labels:  cordova, webview
Cordova Admob Pro
🔥 Cordova Plugin for Google AdMob, DFP, ADX. Easy monetization using mobile Ad, with single line of JavaScript. Compatible with Cordova CLI, Inoic, PhoneGap Build, etc.
Stars: ✭ 690 (+1816.67%)
Mutual labels:  cordova, cordova-plugin

kunder-cordova-plugin-webview

This cordova plugin enables you to open a second webview in your app. This webview is totally independent from the main webview, but allows you tu access plugins and other Cordova resources.

It's possible to modify this plugin to allow multiple webviews.

Report issues on github issue tracker

Installation

    cordova plugin add https://github.com/kunder-lab/cl.kunder.webview.git

Supported Platforms

  • Android
  • iOS

Quick Start

To open a new webview, just call in your app's js:

    webview.Show(URL);

Where URL is the path to the page to be opened. In Android, the plugin automatically adds the prefix file:///android_asset/www/ But only if no *:// or javascript: is present at the front of the URL.

Then, to close the second webview and return to the main view, call in your second webview (the opened webview, not the main webview):

    webview.Close();

This will close and destroy the second webview.

webView

The webViewobject provides a way to manage a second webview inside your cordova app. This could be usefull if you want to open a second page as a popup or you want to load new content that is totally unrelated to the main view, but still have the ability to use cordova plugins.

The main difference with inAppBrowser plugin is that cl.kunder.webview plugin can access and use all cordova plguins installed in your app.

Methods

  • Show: Opens a new webView
  • Close: Close and destroy the webView
  • Hide: Same as Close
  • SubscribeCallback: Suscribes a callback that is fired when webView is closed

Show

Parameters:

  • url: The url to be opened. In Android, if the url does not contain a protocol prefix (*:// or javascript:*), the prefix file:///android_asset/www/ will be automatically added. (String)
  • successCallback: Is triggered when the plugin is succesfully called. (Function)
  • errorCallback: Is triggered when the plugin fails to be called or is called with error. (Function)
  • loading: Should show a loading dialog while webview is loading. (Boolean optional)

SubscribeCallback

Suscribes a callback that is triggered when a webView is closed.

Parameters:

  • successCallback: The callback that will be called when a webview is closed. It contains an array of parameteres given by the Close/Hide method called in the child webview. (Function)
  • errorCallback: Is triggered when the plugin fails to be called or is called with error. (Function)

Usage

// Main webview
// This will be fired on second webview close
webview.SubscribeCallback(function(params) { console.log(params); }, function(){ console.log('error'); })

Close/Hide

Parameters:

  • successCallback: Is triggered when the plugin is succesfully called. (Function)
  • errorCallback: Is triggered when the plugin fails to be called or is called with error. (Function)
  • params: Parameterers that want to be delivered to the parent webview through the SubscribeCallback method. (Array)

HideLoading

Close the loading shown by Show method.

Parameters:

  • successCallback: The callback that will be called when the loading is closed. (Function optional)
  • errorCallback: Is triggered when the plugin fails to be called or is called with error. (Function optional)

SubscribeExitCallback (Android only)

Subscribes an exit callback that is triggered when ExitApp method is called.

Parameters:

  • successCallback: The callback that will be called when a webview is closed. (Function)
  • errorCallback: Is triggered when the plugin fails to be called or is called with error. This can be empty function (Function)

ExitApp (Android)

This method execute the subscribed exit callback if exist. Then close the webview. This method is usefull when onResume event is defined in your main app. You should set a flag in subscribeExitCallback success method. Then in onResume event you should verify the flag value. Finally the main app should call ionic.Platform.exitApp() method to close the app.

ExitApp (iOS)

This method execute objective-C exit(0) method.

SetWebViewBehavior (iOS)

This method adjust the size of the current webview using the iOS 11 status bar space. This method should be called at the beginning of the app. No parameters required.

Other

Cordova Crypt File Plugin compatibility

This plugin is compatible with Cordova Crypt File Plugin. It will detect it automatically and will use decrypted assets files. For more information about Crypt File Plugin, please visit the plugin repo.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].