EddyVerbruggen / nativescript-webview-utils

🕸Add request headers to a NativeScript WebView. Perhaps more utils later.
Apache License 2.0
20 stars 17 forks source link

nativescript-webview-utils is not working in android/ios #1

Closed priyangamani closed 6 years ago

priyangamani commented 6 years ago

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;

batmanbury commented 5 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?