I'm working on a Windows Phone 8 app, which uses the Google.Apis nugets. I have a problem with debugging it on emulator (not all my team members have access to a device). The following code just hangs indefinetely:
await Task.Factory.StartNew(() =>
{
try
{
var result = GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets
{
ClientId = "<my_client_id>",
ClientSecret = "<my_client_secret>"
},
new[] {"https://mail.google.com/email"},
"<user_id_to_be_authorized>",
token).Result;
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
});
And if I change .Result to .ContinueWith((x) => {...}) it always throws a TaskCanceledException contained in AggregateException. The code works fine on my Lumia 920. Is there something I am missing? I've checked the internet connection in emulator and the browser works, I've also done some googling, but with no results.
Try this :