When I am trying to convert NSUrl to URI added an extra slash in the URL below is the method
public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options)
{
Uri uri = new Uri(url.AbsoluteString);
ViewController.Auth?.OnPageLoading(uri);
return true;
}
Output: uri=msauth.com.xxxxx.xxxxxxxx://auth/?code=ae49c2974f4a5ce7becc6ccc95ef98ac8c93cd314aeda9b46254e6f0e6f80957&scope=TriggerApi%20offline_access&state=dshrscvaicthdifb
excepted result: uri=msauth.com.xxxxx.xxxxxxxx://auth?code=ae49c2974f4a5ce7becc6ccc95ef98ac8c93cd314aeda9b46254e6f0e6f80957&scope=TriggerApi%20offline_access&state=dshrscvaicthdifb
Has anyone else encountered this issue?
As you want to remove only the trailing slash, you can try using
uri = uri.TrimEnd('/');I have tested in my local environment, and was able to remove the slash usinguri = uri.TrimEnd('/');