I am creating a Xamarin Android Google map V2 application with custom tiles (UrlTileProvider). I am trying to provide a tile URL to our server which is a secured method requiring a cookie. When I log into the application, the server sends down a cookie to be passed along on subsequent calls. I was assuming I could put this cookie into Android's CookieManager and Google's map tile calls would automatically pass up the cookie but no cookie is being passed along (confirmed with WireShark).
I know there are two Cookie Managers: Android.WebKit (which I assume you use only if you have a WebView) and Java.Net. I've tried both methods just in case but no luck. I believe Java.Net.CookieManager is the right one to be using and I was following the Java document as a guide http://docs.oracle.com/javase/tutorial/networking/cookies/cookiemanager.html.
// initialize in Application.OnCreate
cm = new Java.Net.CookieManager();
Java.Net.CookieHandler.Default = cm;
void SetAuthCookieDelegate(CookieCollection cookies)
{
for (int i = 0; i < cookies.Count; i++)
{
cm.CookieStore.Add(new Java.Net.URI(AppConfig.RemoteServerDomain), new Java.Net.HttpCookie(cookies[i].Name, cookies[i].Value));
}
}
Any ideas how I can get the CookieManager working so other Http calls will pass along my cookies?
Thanks!