diff --git a/Runtime/Common/Events/Public/Interfaces/IAdRevenueListener.cs b/Runtime/Common/Events/Public/Interfaces/IAdRevenueListener.cs index 32451940..871acfdc 100644 --- a/Runtime/Common/Events/Public/Interfaces/IAdRevenueListener.cs +++ b/Runtime/Common/Events/Public/Interfaces/IAdRevenueListener.cs @@ -14,6 +14,14 @@ public interface IAdRevenueListener /// See for more details. /// /// contains info about the tracked impression. + /// + /// + /// On Android, this callback is invoked on a background thread to ensure ad revenue data + /// is delivered immediately without loss, reducing discrepancies when forwarding to MMPs. + /// + /// If you need to interact with Unity Engine APIs (e.g., UI updates), make sure to dispatch those calls to the main thread. + /// See for more details. + /// void OnAdRevenueReceived(AppodealAdRevenue ad); } } diff --git a/Runtime/Common/Events/Public/Scripts/AppodealCallbacks.cs b/Runtime/Common/Events/Public/Scripts/AppodealCallbacks.cs index 0a6989e7..e0735d54 100644 --- a/Runtime/Common/Events/Public/Scripts/AppodealCallbacks.cs +++ b/Runtime/Common/Events/Public/Scripts/AppodealCallbacks.cs @@ -118,6 +118,14 @@ public static AdRevenue Instance /// /// Arguments are of a type . /// + /// + /// + /// On Android, this event is raised on a background thread to ensure ad revenue data + /// is delivered immediately without loss, reducing discrepancies when forwarding to MMPs. + /// + /// If you need to interact with Unity Engine APIs (e.g., UI updates), make sure to dispatch those calls to the main thread. + /// See for more details. + /// public static event EventHandler OnReceived; private void InitializeCallbacks() diff --git a/Runtime/Platforms/Android/Callbacks/AppodealAdRevenueCallback.cs b/Runtime/Platforms/Android/Callbacks/AppodealAdRevenueCallback.cs index 1e1f4388..e76d0ddd 100644 --- a/Runtime/Platforms/Android/Callbacks/AppodealAdRevenueCallback.cs +++ b/Runtime/Platforms/Android/Callbacks/AppodealAdRevenueCallback.cs @@ -25,7 +25,7 @@ private void onAdRevenueReceive(AndroidJavaObject ad) { if (ad == null) { - UnityMainThreadDispatcher.Post(_ => _listener?.OnAdRevenueReceived(null)); + _listener?.OnAdRevenueReceived(null); return; } @@ -41,7 +41,7 @@ private void onAdRevenueReceive(AndroidJavaObject ad) RevenuePrecision = ad.Call(AndroidConstants.JavaMethodName.AdRevenue.GetRevenuePrecision) }; - UnityMainThreadDispatcher.Post(_ => _listener?.OnAdRevenueReceived(adRevenue)); + _listener?.OnAdRevenueReceived(adRevenue); } } }