In my Xamarin App I am using a WebView to retrieve data from a service. The information is stored in the meta-tag of the head of the HTML.
In Xamarin.iOS I could manage to access this information with this code:
webView.LoadFinished += async (sender, args) => {
var request = webView.Request;
if (request != null) {
var url = request.Url.AbsoluteString;
var data = NSData.FromUrl(NSUrl.FromString(Url));
var content = data.ToString();
var splits = content.Split("<meta").ToList();
var taggedSplit = splits.Find(x => x.Contains("myTag"));
if (!string.IsNullOrEmpty(taggedSplit)) {
// do stuff
}
}
}
But i can't find a working solution for Xamarin.Android. I tried this (Access the http response headers in a WebView) approach without success.
Maybe you can help me with this problem.