Ok the problem is “simple”:
IL2CPP is missing System.Web.HttpUtility.ParseQueryString method (for what I understand is the full System.Web that is missing).
It’s possible to replace it?
Will Unity implement it in the future?
In mono (android) everything works… but with mono I cannot do a 64-bit build.
Since IL2CPP is the future (and the only supported scripting backend for iOS) I really wish there is a way to workaround this problem.
Not sure if Unity will add the support for it or I should write it on my own but I really want to solve this problem.
Right now the problem is with this plugin (not made for Unity):
line 1080.
I already tried this:
and I already tried this solution:
private Dictionary<string, string> ParseQueryString(string url) {
var querystring = url.Substring(url.IndexOf('?') + 1);
var pairs = querystring.Split('&');
var dict = pairs.Select(pair => { var valuePair = pair.Split('=');
return new KeyValuePair<string, string>(valuePair[0], valuePair[1]); }) .ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value); return dict;
}
Both are not working.
I also tried to modify the RestSharp code by copying the original source code of those classes:
But I was only able to get a BadApi response.
I already had to recompile JSON .NET For Unity | Input Management | Unity Asset Store
since MegaApiClient require version 10 (and json net for unity is version 8.3 but 100% compatible).
Any ideas? Thank you.
PS. After a bit of debugging I even tried
UriBuilder builder = new UriBuilder(BaseApiUri);
var arguments = "";
foreach (var item in query)
{
arguments = arguments + item.Key + "=" + item.Value + "&";
}
arguments = arguments.Substring(0, arguments.Length -1);
builder.Query = arguments.ToString();
return builder.Uri;
This stupid solution still works on the Editor but it still give an ApiException: BadSessionId on mobile (a MegaApiClient Exception).
/// API_ESID (-15): Invalid or expired user session, please relogin
Not sure why at this point.