Request headers refresh
I have to play video in my Xamarin.Forms application from web service that needs authentication, so I have to set authentication request headers on request. And everything is ok when I set headers for the first time (in OnStart method in App.xaml.cs). But, when I have to refresh these headers (after application resuming for example- in OnResume method in App.xaml.cs) after access token expiration, I'm getting failure with 401 code. I'm setting headers like this:
if (CrossMediaManager.Current.RequestHeaders.ContainsKey("Authorization")) CrossMediaManager.Current.RequestHeaders.Remove("Authorization"); CrossMediaManager.Current.RequestHeaders.Add("Authorization", "Bearer " + AccessToken);
Am I doing something wrong or?
Fix in https://github.com/martijn00/XamarinMediaManager/commit/34e61f95f87e4bdd229dc72ea3e0f99a5c630870
Next time fill out the issue template or your issue will get closed.
Also you need to set a complete new object on it, otherwise the change will not be triggered.
Hi again! Sorry for not answering, I was working on another project and had no time for testing this. Can you just please give me an example because I'm not sure what do you mean by "set a complete new object on it". Sorry for bothering again...
Thanks!