Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

OAuth2Request "ends" when I call request.GetResponseAsync()

$
0
0

I've got a Xamarin.Forms application running against the spotify service, using the Xamarin.Auth library. Right now the user is able to login using the OAuth2Authenticator. Once completed, the event args account information is stored in the AccountStore. I've used breakpoints to make sure everything is coming through, and it seems like the request is building right. I've tried both HttpClient and OAuth2Request and both freeze once they await the response.

`
var account = AccountStore.Create().FindAccountsForService(Constants.AppName).FirstOrDefault();

var request = new OAuth2Request("GET", new Uri(<user's playlists api call>), null, account);

var response = await request.GetResponseAsync();

if (response != null) {

var playlistJson = await response.GetResponseTextAsync();

playlists = JsonConvert.DeserializeObject<List>((string)Newtonsoft.Json.Linq.JObject.Parse(playlistJson)["items"]);

}
`
Can't add links yet apparently, but I can assure you the api call in the Uri section is the right one.

Again, the account and request variables are assigned properly, but the response throws no error and just stops executing. In turn it makes the simulator the front window without re-selecting.

Any ideas why this is happening, breakpoints are telling me nothing?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>