You've already forked Commercialization.tapadn
Add iOS support for TapADN package
This commit is contained in:
@@ -580,12 +580,12 @@ namespace Dirichlet.Mediation
|
||||
|
||||
/// <summary>
|
||||
/// Shows a reward video ad with automatic load-and-show logic.
|
||||
/// Android only - iOS will call onFailure with not_supported error.
|
||||
/// Android bridge maps to native auto cache; higher layers may emulate load-then-show elsewhere.
|
||||
/// </summary>
|
||||
void ShowRewardVideoAutoAd(DirichletAdRequest request, IDirichletRewardVideoAutoAdListener listener);
|
||||
|
||||
/// <summary>
|
||||
/// Shows an interstitial ad with automatic load-and-show logic. Android only.
|
||||
/// Shows an interstitial ad with automatic load-and-show logic. Android bridge maps to native auto cache.
|
||||
/// </summary>
|
||||
void ShowInterstitialAutoAd(DirichletAdRequest request, IDirichletInterstitialAutoAdListener listener);
|
||||
|
||||
@@ -595,7 +595,7 @@ namespace Dirichlet.Mediation
|
||||
void ShowBannerAutoAd(DirichletAdRequest request, DirichletAdShowOptions options, IDirichletBannerAutoAdListener listener);
|
||||
|
||||
/// <summary>
|
||||
/// Shows a splash ad with automatic load logic. Android only.
|
||||
/// Shows a splash ad with automatic load logic. Android bridge maps to native auto cache.
|
||||
/// </summary>
|
||||
void ShowSplashAutoAd(DirichletAdRequest request, DirichletAdShowOptions options, IDirichletSplashAutoAdListener listener);
|
||||
|
||||
@@ -1563,20 +1563,9 @@ namespace Dirichlet.Mediation
|
||||
}
|
||||
first = false;
|
||||
|
||||
jsonBuilder.Append($"\"{kv.Key}\":");
|
||||
|
||||
if (kv.Value is string)
|
||||
{
|
||||
jsonBuilder.Append($"\"{kv.Value}\"");
|
||||
}
|
||||
else if (kv.Value is bool)
|
||||
{
|
||||
jsonBuilder.Append(((bool)kv.Value) ? "true" : "false");
|
||||
}
|
||||
else
|
||||
{
|
||||
jsonBuilder.Append(kv.Value.ToString());
|
||||
}
|
||||
AppendJsonString(jsonBuilder, kv.Key);
|
||||
jsonBuilder.Append(":");
|
||||
AppendJsonValue(jsonBuilder, kv.Value);
|
||||
}
|
||||
|
||||
jsonBuilder.Append("}");
|
||||
@@ -1589,6 +1578,84 @@ namespace Dirichlet.Mediation
|
||||
}
|
||||
}
|
||||
|
||||
private static void AppendJsonValue(System.Text.StringBuilder builder, object value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
builder.Append("null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (value is string stringValue)
|
||||
{
|
||||
AppendJsonString(builder, stringValue);
|
||||
return;
|
||||
}
|
||||
|
||||
if (value is bool boolValue)
|
||||
{
|
||||
builder.Append(boolValue ? "true" : "false");
|
||||
return;
|
||||
}
|
||||
|
||||
if (value is IFormattable formattable)
|
||||
{
|
||||
builder.Append(formattable.ToString(null, CultureInfo.InvariantCulture));
|
||||
return;
|
||||
}
|
||||
|
||||
AppendJsonString(builder, value.ToString());
|
||||
}
|
||||
|
||||
private static void AppendJsonString(System.Text.StringBuilder builder, string value)
|
||||
{
|
||||
builder.Append('"');
|
||||
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
foreach (var c in value)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case '\\':
|
||||
builder.Append("\\\\");
|
||||
break;
|
||||
case '"':
|
||||
builder.Append("\\\"");
|
||||
break;
|
||||
case '\b':
|
||||
builder.Append("\\b");
|
||||
break;
|
||||
case '\f':
|
||||
builder.Append("\\f");
|
||||
break;
|
||||
case '\n':
|
||||
builder.Append("\\n");
|
||||
break;
|
||||
case '\r':
|
||||
builder.Append("\\r");
|
||||
break;
|
||||
case '\t':
|
||||
builder.Append("\\t");
|
||||
break;
|
||||
default:
|
||||
if (char.IsControl(c))
|
||||
{
|
||||
builder.Append("\\u");
|
||||
builder.Append(((int)c).ToString("x4", CultureInfo.InvariantCulture));
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.Append(c);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
builder.Append('"');
|
||||
}
|
||||
|
||||
private void RemoveLoadCallback(string handleId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(handleId))
|
||||
@@ -2032,5 +2099,3 @@ namespace Dirichlet.Mediation
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user