diff --git a/Assets/Script/SDKManager/AppSDKManager.cs b/Assets/Script/SDKManager/AppSDKManager.cs index e4ea7ad..2a6ac36 100644 --- a/Assets/Script/SDKManager/AppSDKManager.cs +++ b/Assets/Script/SDKManager/AppSDKManager.cs @@ -11,7 +11,7 @@ using UnityEngine; using WZ; public class AppSDKManager : D_MonoSingleton -{ +{ public void Init(Action action, bool showLog) { LoggerUtils.Enabled = showLog; @@ -655,6 +655,15 @@ public class AppSDKManager : D_MonoSingleton } + /// + /// Webview展示成功后回调 + /// + /// + public void WebviewShowSuccess(Action action) + { + EFSdkManager.Instance.SetWebviewShowSuccessAction(action); + } + #endregion /// diff --git a/Assets/Script/SDKManager/EFSdkManager/EFSdkManager.cs b/Assets/Script/SDKManager/EFSdkManager/EFSdkManager.cs index 77d543c..d90c3d5 100644 --- a/Assets/Script/SDKManager/EFSdkManager/EFSdkManager.cs +++ b/Assets/Script/SDKManager/EFSdkManager/EFSdkManager.cs @@ -1,4 +1,5 @@ -using EFSDK; +using System; +using EFSDK; using Firebase.Analytics; using UnityEngine; @@ -11,13 +12,22 @@ namespace WZ //互动广告位 private string okspinShowPos = ""; + private Action _webviewShowSuccessAction; + public void Init() { if (Application.isEditor) { return; } - EFSdk.get().Init((actionType, str) => { }); + EFSdk.get().Init((actionType, str) => + { + if (actionType == EFSdk.ActionType.H5_Load_Succ) + { + //webview展示成功 + _webviewShowSuccessAction?.Invoke(str); + } + }); SetSDKEventCallback(); SetHdH5ImpressionCallback(); @@ -46,12 +56,6 @@ namespace WZ return; } - //判断链接是互动广告 - if (!url.Contains("gamifyspace")) - { - return; - } - //展示次数 int count = PlayerPrefsUtils.GetPlayerPrefsInt(KEY_OKSPIN_SHOW_COUNT, 0); count++; @@ -73,5 +77,10 @@ namespace WZ { okspinShowPos = pos; } + + public void SetWebviewShowSuccessAction(Action action) + { + _webviewShowSuccessAction = action; + } } } \ No newline at end of file