I have an HTML content which includes an <img>
. This <img>
has an image url which will display the content only if the user is authenticated.
I have created the WebView as follows:-
wvDetail = FindViewById<WebView>(Resource.Id.wvDEtail);
var data = AppHelper.SelectedNews;
wvDetail.Settings.JavaScriptEnabled = true;
var mData = "<p><span style=\"color :#000000;font-family:"open sans", arial, sans-serif;text-align:justify;background-color:#ffffff;\">Proin sem urna, aliquet vel placerat quis, semper et mauris. Sed vel nunc lacus. Vestibulum vitae nisl eros. Donec ullamcorper sem nisl, in pellentesque quam tempus vel. Curabitur in felis nec urna placerat finibus. Donec ut nisi eu enim tincidunt luctus. Phasellus eleifend tortor est, nec maximus est aliquet sit amet. Praesent mollis massa id lacinia volutpat. Vestibulum eget odio sit amet enim fringilla pulvinar.</span></p><p><br></p><p><img src=\"http://example.com/somesecuredimage.png" alt=\"somesecuredimage.png\" style=\"margin:5px;width:640px;\" /><br></p><p><br></p><p><br></p><p><br></p><p><br></p>";
wvDetail.LoadData(mData, "text/html", "utf-8");
I have an access token which I need to set as bearer to the Authorization header or pass as cookie to this Webview in order to load all the secured images included in the html content.
I have seen solutions where we can pass the headers as a parameter but with the LoadUrl()
. Is there a way I can do the same while loading the HTML text instead?
Any help is appreciated