Closed priyangamani closed 6 years ago
I'm seeing this exact issue, just trying to follow the sample provided in the README, and just like you show here. Did you find the solution to this, or was it resolved outside of this thread? What was the reason you closed it?
I tried to run the app in both android/ios got the error like this WebViewUtils.addHeaders is not a function,undefined...
JS code: var WebView =require("tns-core-modules/ui/web-view"); var WebViewUtils=require("nativescript-webview-utils");
function webViewLoaded(args) { var wv = args.object; // as a bonus, hide those ugly Android zoomcontrols if (wv.android) { wv.android.getSettings().setBuiltInZoomControls(false); } var headers = new Map(); headers.set("Foo", "Bar :P"); headers.set("X-Custom-Header", "Set at " + new Date().toTimeString()); WebViewUtils.addHeaders(wv, headers); } exports.webViewLoaded = webViewLoaded;