release: 1.4.7

This commit is contained in:
2026-04-22 17:44:49 +08:00
parent 79f478dd5f
commit e38e066a2d
37 changed files with 2598 additions and 78 deletions

View File

@@ -7,6 +7,7 @@ public class ToponAdController : IAdController
{
public static string LastDetectedArea { get; private set; }
public static string LastAreaError { get; private set; }
public static ToponControllerOptions CurrentOptions { get; private set; }
private Action<bool> _maskAction;
private Action<string, string> _logEventAction;
@@ -20,14 +21,16 @@ public class ToponAdController : IAdController
_adConfig = adConfig;
_controllerOptions = ToponControllerOptions.Resolve(adConfig, args);
CurrentOptions = _controllerOptions;
ApplyPreInitOptions(_controllerOptions);
var isDebug = _controllerOptions.Debug ?? false;
ATSDKAPI.setLogDebug(isDebug);
ATSDKAPI.initSDK(adConfig.Id , adConfig.Key);
StartChinaMainlandSdkIfNeeded();
ApplyPostInitOptions(_controllerOptions);
if (isDebug)
if (_controllerOptions.AutoOpenDebuggerUI)
{
ShowAndroidTest ();
}
@@ -103,6 +106,11 @@ public class ToponAdController : IAdController
return;
}
if (!string.IsNullOrWhiteSpace(options.LocalStrategyAssetPath))
{
ATSDKAPI.setLocalStrategyAssetPath(options.LocalStrategyAssetPath);
}
if (options.InitCustomMap != null && options.InitCustomMap.Count > 0)
{
ATSDKAPI.initCustomMap(options.InitCustomMap);
@@ -163,6 +171,26 @@ public class ToponAdController : IAdController
}
}
private static void StartChinaMainlandSdkIfNeeded()
{
#if UNITY_ANDROID && !UNITY_EDITOR
try
{
if (!ATSDKAPI.isCnSDK())
{
return;
}
ATSDKAPI.start();
Debug.Log("[Topon] Called ATSDK.start() for China mainland SDK.");
}
catch (Exception exception)
{
Debug.LogWarning($"[Topon] Failed to call ATSDK.start(): {exception.Message}");
}
#endif
}
private sealed class ToponAreaListener : ATGetAreaListener
{
private readonly ToponAdController _controller;