index.android.js
function getAndroidJSInterface(oWebViewInterface){
    var AndroidWebViewInterface = com.shripalsoni.natiescriptwebviewinterface.WebViewInterface.extend({
        /**
         * On call from webView to android, this function is called from handleEventFromWebView method of WebViewInerface class
         */
        onWebViewEvent: function(webViewId, eventName, jsonData){
            // getting webviewInterface object by webViewId from static map.
            var oWebViewInterface = getWebViewIntefaceObjByWebViewId(webViewId);
            if (oWebViewInterface) {
                oWebViewInterface._onWebViewEvent(eventName, jsonData);
            }
        }
    });
    
    // creating androidWebViewInterface with unique web-view id.
    return new AndroidWebViewInterface(new java.lang.String(''+oWebViewInterface.id));
 }
function getAndroidJSInterface(oWebViewInterface){
    var AndroidWebViewInterface = com.shripalsoni.natiescriptwebviewinterface.WebViewInterface.extend({
        /**
         * On call from webView to android, this function is called from handleEventFromWebView method of WebViewInerface class
         */
        onWebViewEvent: function(webViewId, eventName, jsonData){
            // getting webviewInterface object by webViewId from static map.
            var oWebViewInterface = getWebViewIntefaceObjByWebViewId(webViewId);
            if (oWebViewInterface) {
                oWebViewInterface._onWebViewEvent(eventName, jsonData);
            }
        }
    });
    
    // creating androidWebViewInterface with unique web-view id.
    return new AndroidWebViewInterface(new java.lang.String(''+oWebViewInterface.id));
 }
function getAndroidJSInterface ( oWebViewInterface ) { var AndroidWebViewInterface = com . shripalsoni . natiescriptwebviewinterface . WebViewInterface . extend ( { /**
         * On call from webView to android, this function is called from handleEventFromWebView method of WebViewInerface class
         */ onWebViewEvent : function ( webViewId , eventName , jsonData ) { // getting webviewInterface object by webViewId from static map. var oWebViewInterface = getWebViewIntefaceObjByWebViewId ( webViewId ) ; if ( oWebViewInterface ) { oWebViewInterface . _onWebViewEvent ( eventName , jsonData ) ; } } } ) ; // creating androidWebViewInterface with unique web-view id. return new AndroidWebViewInterface ( new java . lang . String ( '' + oWebViewInterface . id ) ) ; }
Factory function to provide instance of Android JavascriptInterface.
Factory function to provide instance of Android JavascriptInterface .