Firstborn/Library/PackageCache/com.unity.ads@3.7.5/Runtime/Monetization/JavaMapUtilities.cs
Schaken-Mods b486678290 Library -Artifacts
Library -Artifacts
2023-03-28 12:24:16 -05:00

26 lines
757 B
C#

using System.Collections.Generic;
namespace UnityEngine.Monetization
{
internal class JavaMapUtilities
{
public static IDictionary<string, object> GetDictionaryForJavaMap(AndroidJavaObject javaMap)
{
if (javaMap == null)
{
return new Dictionary<string, object>();
}
var jsonJavaObject = new AndroidJavaObject("org.json.JSONObject", javaMap);
var json = jsonJavaObject.Call<string>("toString");
var jsonObject = MiniJSON.Json.Deserialize(json);
if (jsonObject is IDictionary<string, object> objects)
{
return objects;
}
return new Dictionary<string, object>();
}
}
}