I am having an issue where my Android app reaches an API that has a token, but the token is not getting sent back to the app. I get the error:
System.MissingMethodException: Default constructor not found for type System.string
I am using Xamarin.Android (C#). I'm trying to add a method to my Android/DataUtility.cs that calls an REST WebAPI method that returns a token. The token is not coming back to Android. What am I missing?
I've tried breakpoints, stepping through, multiple alterations of the URL, postman, async and non async methods, tasks, etc. I've tried searching on this as well as the error above.
public async void startVisit(VisitDetailsResponse visit)
{
myClient = new FM.LiveSwitch.Client(SettingsValues.GatewayURL, appID);
Register();
}
public void Register()
{
var RegURL = "/GetLSRegisterToken?wsUserID=" + myClient.UserId + "&wsDeviceID=" + myClient.DeviceId + "&wsID=" + myClient.Id + "&channelName=" + channelName;
var registerToken = DataUtility.GetLiveSwitchTokenResponseAsync(SettingsValues.ApiURLValue, RegURL).Result;
}
It does get to WebAPI, which has a token(screenshot below), but it never gets back to the return statement in DataUtility (line 427 in screenshot above) (Note: I can call the WebAPI method and return a value successfully from Postman)




I got this to work by placing it inside async Task: