广告关闭时返回收益

This commit is contained in:
juncong lee 2025-09-01 22:14:33 +08:00
parent 3d4d79b52f
commit f3df0ff6a6
9 changed files with 62 additions and 53 deletions

View File

@ -66,7 +66,7 @@ namespace WZ
/// <summary> /// <summary>
/// 显示插页广告 /// 显示插页广告
/// </summary> /// </summary>
void DisplayInterstitial(string _adPos, IvType _IvType = IvType.IV1, Action _closeCallback = null); void DisplayInterstitial(string _adPos, IvType _IvType = IvType.IV1, Action<double> _closeCallback = null);
/// <summary> /// <summary>
/// 获取插页广告收益信息 /// 获取插页广告收益信息
@ -90,7 +90,7 @@ namespace WZ
/// <summary> /// <summary>
/// 显示激励广告 /// 显示激励广告
/// </summary> /// </summary>
void DisplayRewarded(string _adPos, Action<bool> _rewardCallback = null, Action _showFailedCallback = null); void DisplayRewarded(string _adPos, Action<bool,double> _rewardCallback = null, Action _showFailedCallback = null);
/// <summary> /// <summary>
/// 获取激励广告收益信息 /// 获取激励广告收益信息

View File

@ -24,8 +24,8 @@ namespace WZ
private List<string> _bannerAdUnits = new List<string>(); private List<string> _bannerAdUnits = new List<string>();
private string _rvPos; private string _rvPos;
private string _ivPos; private string _ivPos;
private Action<bool> _rvCloseCallback = null; private Action<bool,double> _rvCloseCallback = null;
private Action _ivCloseCallback = null; private Action<double> _ivCloseCallback = null;
private Action _rvShowFailedCallback = null; private Action _rvShowFailedCallback = null;
private bool _initialized = false; private bool _initialized = false;
private float _rvStartLoadTime = 0; private float _rvStartLoadTime = 0;
@ -77,7 +77,7 @@ namespace WZ
_rvStartLoadTime = Time.realtimeSinceStartup; _rvStartLoadTime = Time.realtimeSinceStartup;
AdsActionEvents.TrackAdStartLoad(Platfrom, "", "", AdsType.Rewarded); AdsActionEvents.TrackAdStartLoad(Platfrom, "", "", AdsType.Rewarded);
} }
public void DisplayRewarded(string adPos, Action<bool> rewardCallback = null, Action showFailedCallback = null) public void DisplayRewarded(string adPos, Action<bool,double> rewardCallback = null, Action showFailedCallback = null)
{ {
_rvPos = adPos; _rvPos = adPos;
_rvCloseCallback = rewardCallback; _rvCloseCallback = rewardCallback;
@ -114,7 +114,7 @@ namespace WZ
private void OnRewardedAdDismissed(string adSource,string adUnitId,double revenue) private void OnRewardedAdDismissed(string adSource,string adUnitId,double revenue)
{ {
AdsActionEvents.TrackAdClosed(Platfrom,adSource,adUnitId,AdsType.Rewarded,_rvPos,revenue); AdsActionEvents.TrackAdClosed(Platfrom,adSource,adUnitId,AdsType.Rewarded,_rvPos,revenue);
_rvCloseCallback?.Invoke(true); _rvCloseCallback?.Invoke(true,revenue);
_rvCloseCallback = null; _rvCloseCallback = null;
LoadRewarded(); LoadRewarded();
} }
@ -162,7 +162,7 @@ namespace WZ
return _admobInterstitialAdManager.GetHighestPayingAdRevenue(); return _admobInterstitialAdManager.GetHighestPayingAdRevenue();
} }
public void DisplayInterstitial(string ivPos, IvType _IvType = IvType.IV1, Action closeCallback = null) public void DisplayInterstitial(string ivPos, IvType _IvType = IvType.IV1, Action<double> closeCallback = null)
{ {
_ivPos = ivPos; _ivPos = ivPos;
_ivCloseCallback = closeCallback; _ivCloseCallback = closeCallback;
@ -201,7 +201,7 @@ namespace WZ
private void OnInterstitialAdDismissed(string adSource,string adUnitId,double revenue) private void OnInterstitialAdDismissed(string adSource,string adUnitId,double revenue)
{ {
AdsActionEvents.TrackAdClosed(Platfrom, adSource, adUnitId, AdsType.Interstitial, "", revenue); AdsActionEvents.TrackAdClosed(Platfrom, adSource, adUnitId, AdsType.Interstitial, "", revenue);
_ivCloseCallback?.Invoke(); _ivCloseCallback?.Invoke(revenue);
_ivCloseCallback = null; _ivCloseCallback = null;
LoadInterstitial(); LoadInterstitial();
} }
@ -209,7 +209,7 @@ namespace WZ
private void OnInterstitialAdError(string adUnitId, int errorCode, string errorMsg) private void OnInterstitialAdError(string adUnitId, int errorCode, string errorMsg)
{ {
AdsActionEvents.TrackAdFailToShow(Platfrom,AdsType.Interstitial,errorMsg,""); AdsActionEvents.TrackAdFailToShow(Platfrom,AdsType.Interstitial,errorMsg,"");
_ivCloseCallback?.Invoke(); _ivCloseCallback?.Invoke(0);
_ivCloseCallback = null; _ivCloseCallback = null;
LoadInterstitial(); LoadInterstitial();
} }

View File

@ -63,7 +63,7 @@ namespace WZ
/// 展示激励广告 /// 展示激励广告
/// </summary> /// </summary>
/// <param name="callback"></param> /// <param name="callback"></param>
public void ShowRewardAd(string _adPos, Action<bool> _rewardCallback = null, Action _showFailedCallback = null) public void ShowRewardAd(string _adPos, Action<bool,double> _rewardCallback = null, Action _showFailedCallback = null)
{ {
AdsActionEvents.TrackAdPosition(AdsType.Rewarded, _adPos); AdsActionEvents.TrackAdPosition(AdsType.Rewarded, _adPos);
if (!IsRewardAdReady()) if (!IsRewardAdReady())
@ -110,12 +110,12 @@ namespace WZ
/// 展示激励广告 /// 展示激励广告
/// </summary> /// </summary>
/// <param name="callback"></param> /// <param name="callback"></param>
public void ShowInterstitialAd(string _adPos, IvType _IvType = IvType.IV1, Action _closeCallback = null) public void ShowInterstitialAd(string _adPos, IvType _IvType = IvType.IV1, Action<double> _closeCallback = null)
{ {
AdsActionEvents.TrackAdPosition(AdsType.Interstitial, _adPos); AdsActionEvents.TrackAdPosition(AdsType.Interstitial, _adPos);
if (!IsRewardAdReady()) if (!IsRewardAdReady())
{ {
_closeCallback?.Invoke(); _closeCallback?.Invoke(0);
_closeCallback = null; _closeCallback = null;
return; return;
} }
@ -144,7 +144,7 @@ namespace WZ
} }
else else
{ {
_closeCallback?.Invoke(); _closeCallback?.Invoke(0);
} }
AdPlayCountManager.IncrementAdPlayCount(AdsType.Interstitial); AdPlayCountManager.IncrementAdPlayCount(AdsType.Interstitial);

View File

@ -19,8 +19,8 @@ namespace WZ
private bool _initialized; private bool _initialized;
private string _rvPos; private string _rvPos;
private string _IvPos; private string _IvPos;
private Action<bool> _rvCloseCallback = null; private Action<bool,double> _rvCloseCallback = null;
private Action _ivCloseCallback = null; private Action<double> _ivCloseCallback = null;
private Action _rvShowFailedCallback = null; private Action _rvShowFailedCallback = null;
private float _rvStartLoadTime = 0; private float _rvStartLoadTime = 0;
@ -56,7 +56,7 @@ namespace WZ
// 各个回调处理方法 // 各个回调处理方法
private void OnRewardedAdLoaded(string adUnitId) private void OnRewardedAdLoaded(string adUnitId)
{ {
AdsActionEvents.TrackAdLoaded(Platfrom,ClientName, adUnitId, AdsType.Rewarded,Time.realtimeSinceStartup - _rvStartLoadTime);
} }
private void OnRewardedAdLoadFailed(string adUnitId, int code, string msg) private void OnRewardedAdLoadFailed(string adUnitId, int code, string msg)
@ -68,10 +68,10 @@ namespace WZ
{ {
} }
private void OnRewardedAdDismissed(string adUnitId) private void OnRewardedAdDismissed(string adUnitId,double revenue)
{ {
AdsActionEvents.TrackAdClosed(Platfrom,ClientName, adUnitId, AdsType.Rewarded, _rvPos, GetRewardedRevenue()); AdsActionEvents.TrackAdClosed(Platfrom,ClientName, adUnitId, AdsType.Rewarded, _rvPos, revenue);
_rvCloseCallback?.Invoke(true); _rvCloseCallback?.Invoke(true,revenue);
_rvCloseCallback = null; _rvCloseCallback = null;
LoadRewarded(); LoadRewarded();
@ -85,9 +85,9 @@ namespace WZ
LoadRewarded(); LoadRewarded();
} }
private void OnRewardedAdClicked(string adUnitId) private void OnRewardedAdClicked(string adUnitId,double revenue)
{ {
AdsActionEvents.TrackAdClicked(Platfrom,ClientName,adUnitId,AdsType.Rewarded,_rvPos,GetRewardedRevenue()); AdsActionEvents.TrackAdClicked(Platfrom,ClientName,adUnitId,AdsType.Rewarded,_rvPos,revenue);
} }
public void LoadRewarded() public void LoadRewarded()
@ -117,7 +117,7 @@ namespace WZ
return _rewardedAdManager.GetAvailableAdUnits().Count > 0; return _rewardedAdManager.GetAvailableAdUnits().Count > 0;
} }
public void DisplayRewarded(string adPos, Action<bool> rewardCallback = null, Action showFailedCallback = null) public void DisplayRewarded(string adPos, Action<bool,double> rewardCallback = null, Action showFailedCallback = null)
{ {
_rvPos = adPos; _rvPos = adPos;
_rvCloseCallback = rewardCallback; _rvCloseCallback = rewardCallback;
@ -133,7 +133,7 @@ namespace WZ
#region 广 #region 广
private void OnInterstitialAdLoaded(string adUnitId) private void OnInterstitialAdLoaded(string adUnitId)
{ {
AdsActionEvents.TrackAdLoaded(Platfrom,ClientName, adUnitId, AdsType.Interstitial,Time.realtimeSinceStartup - _ivStartLoadTime);
} }
private void OnInterstitialAdLoadFailed(string adUnitId, int code, string msg) private void OnInterstitialAdLoadFailed(string adUnitId, int code, string msg)
@ -145,10 +145,10 @@ namespace WZ
{ {
} }
private void OnInterstitialAdDismissed(string adUnitId) private void OnInterstitialAdDismissed(string adUnitId,double revenue)
{ {
AdsActionEvents.TrackAdClosed(Platfrom,ClientName, adUnitId, AdsType.Interstitial, "", GetInterstitialRevenue()); AdsActionEvents.TrackAdClosed(Platfrom,ClientName, adUnitId, AdsType.Interstitial, "", GetInterstitialRevenue());
_ivCloseCallback?.Invoke(); _ivCloseCallback?.Invoke(revenue);
_ivCloseCallback = null; _ivCloseCallback = null;
LoadInterstitial(); LoadInterstitial();
} }
@ -156,7 +156,7 @@ namespace WZ
private void OnInterstitialAdError(string adUnitId, int code, string msg) private void OnInterstitialAdError(string adUnitId, int code, string msg)
{ {
AdsActionEvents.TrackAdFailToShow(Platfrom, AdsType.Interstitial, msg, ""); AdsActionEvents.TrackAdFailToShow(Platfrom, AdsType.Interstitial, msg, "");
_ivCloseCallback?.Invoke(); _ivCloseCallback?.Invoke(0);
_ivCloseCallback = null; _ivCloseCallback = null;
LoadInterstitial(); LoadInterstitial();
@ -194,7 +194,7 @@ namespace WZ
return _interstitialAdManager.GetAvailableAdUnits().Count > 0; return _interstitialAdManager.GetAvailableAdUnits().Count > 0;
} }
public void DisplayInterstitial(string ivPos, IvType _IvType = IvType.IV1, Action closeCallback = null) public void DisplayInterstitial(string ivPos, IvType _IvType = IvType.IV1, Action<double> closeCallback = null)
{ {
_IvPos = ivPos; _IvPos = ivPos;
_ivCloseCallback = closeCallback; _ivCloseCallback = closeCallback;

View File

@ -17,7 +17,7 @@ namespace WZ
public void InitializeAdUnits(List<string> adUnitIds, Action<string> onAdLoaded = null, public void InitializeAdUnits(List<string> adUnitIds, Action<string> onAdLoaded = null,
Action<string, int, string> onAdLoadFailed = null, Action<string, int, string> onAdLoadFailed = null,
Action<string> onAdShowed = null, Action<string> onAdShowed = null,
Action<string> onAdDismissed = null, Action<string,double> onAdDismissed = null,
Action<string, int, string> onAdError = null, Action<string, int, string> onAdError = null,
Action<string> onAdClicked = null) Action<string> onAdClicked = null)
{ {
@ -30,7 +30,7 @@ namespace WZ
private void CreateRewardedAd(string adUnitId, Action<string> onAdLoaded, private void CreateRewardedAd(string adUnitId, Action<string> onAdLoaded,
Action<string, int, string> onAdLoadFailed, Action<string, int, string> onAdLoadFailed,
Action<string> onAdShowed, Action<string> onAdShowed,
Action<string> onAdDismissed, Action<string,double> onAdDismissed,
Action<string, int, string> onAdError, Action<string, int, string> onAdError,
Action<string> onAdClicked) Action<string> onAdClicked)
{ {
@ -76,7 +76,7 @@ namespace WZ
interstitialAd.OnAdDismissed += (() => interstitialAd.OnAdDismissed += (() =>
{ {
LoggerUtils.Debug($"[Bigo] Interstitial -[interaction]: {adUnitId} dismiss"); LoggerUtils.Debug($"[Bigo] Interstitial -[interaction]: {adUnitId} dismiss");
onAdDismissed?.Invoke(adUnitId); onAdDismissed?.Invoke(adUnitId,GetAdRevenue(interstitialAd));
}); });
interstitialAd.OnAdError += ((code, msg) => interstitialAd.OnAdError += ((code, msg) =>

View File

@ -17,9 +17,9 @@ namespace WZ
public void InitializeAdUnits(List<string> adUnitIds, Action<string> onAdLoaded = null, public void InitializeAdUnits(List<string> adUnitIds, Action<string> onAdLoaded = null,
Action<string, int, string> onAdLoadFailed = null, Action<string, int, string> onAdLoadFailed = null,
Action<string> onAdShowed = null, Action<string> onAdShowed = null,
Action<string> onAdDismissed = null, Action<string,double> onAdDismissed = null,
Action<string, int, string> onAdError = null, Action<string, int, string> onAdError = null,
Action<string> onAdClicked = null) Action<string,double> onAdClicked = null)
{ {
foreach (var adUnitId in adUnitIds) foreach (var adUnitId in adUnitIds)
{ {
@ -30,9 +30,9 @@ namespace WZ
private void CreateRewardedAd(string adUnitId, Action<string> onAdLoaded, private void CreateRewardedAd(string adUnitId, Action<string> onAdLoaded,
Action<string, int, string> onAdLoadFailed, Action<string, int, string> onAdLoadFailed,
Action<string> onAdShowed, Action<string> onAdShowed,
Action<string> onAdDismissed, Action<string, double> onAdDismissed,
Action<string, int, string> onAdError, Action<string, int, string> onAdError,
Action<string> onAdClicked) Action<string,double> onAdClicked)
{ {
if (_rewardedAds.ContainsKey(adUnitId)) if (_rewardedAds.ContainsKey(adUnitId))
{ {
@ -76,7 +76,7 @@ namespace WZ
rewardedAd.OnAdDismissed += (() => rewardedAd.OnAdDismissed += (() =>
{ {
LoggerUtils.Debug($"[Bigo] Rewarded-[interaction]: {adUnitId} dismiss"); LoggerUtils.Debug($"[Bigo] Rewarded-[interaction]: {adUnitId} dismiss");
onAdDismissed?.Invoke(adUnitId); onAdDismissed?.Invoke(adUnitId,GetAdRevenue(rewardedAd));
}); });
rewardedAd.OnAdError += ((code, msg) => rewardedAd.OnAdError += ((code, msg) =>
@ -87,7 +87,7 @@ namespace WZ
rewardedAd.OnAdClicked += () => rewardedAd.OnAdClicked += () =>
{ {
onAdClicked?.Invoke(adUnitId); onAdClicked?.Invoke(adUnitId,GetAdRevenue(rewardedAd));
}; };
LoadAd(adUnitId); LoadAd(adUnitId);
} }

View File

@ -23,8 +23,8 @@ namespace WZ
private float _ivStartLoadTime = 0; private float _ivStartLoadTime = 0;
private string _rvPos; private string _rvPos;
private string _ivPos; private string _ivPos;
private Action<bool> _rvCloseCallback = null; private Action<bool,double> _rvCloseCallback = null;
private Action _ivCloseCallback = null; private Action<double> _ivCloseCallback = null;
private Action _rvShowFailedCallback = null; private Action _rvShowFailedCallback = null;
public void Initialize() public void Initialize()
@ -77,7 +77,7 @@ namespace WZ
AdsActionEvents.TrackAdStartLoad(Platfrom, "", "", AdsType.Rewarded); AdsActionEvents.TrackAdStartLoad(Platfrom, "", "", AdsType.Rewarded);
_rvStartLoadTime = Time.realtimeSinceStartup; _rvStartLoadTime = Time.realtimeSinceStartup;
} }
public void DisplayRewarded(string adPos, Action<bool> rewardCallback = null, Action showFailedCallback = null) public void DisplayRewarded(string adPos, Action<bool,double> rewardCallback = null, Action showFailedCallback = null)
{ {
_rvPos = adPos; _rvPos = adPos;
_rvCloseCallback = rewardCallback; _rvCloseCallback = rewardCallback;
@ -150,7 +150,7 @@ namespace WZ
private void OnRewardedAdHiddenEvent(string adUnitId, MaxSdkBase.AdInfo adInfo) private void OnRewardedAdHiddenEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
{ {
_rvCloseCallback?.Invoke(true); _rvCloseCallback?.Invoke(true,adInfo.Revenue);
_rvCloseCallback = null; _rvCloseCallback = null;
LoadRewarded(); LoadRewarded();
LoggerUtils.Debug("[Max] OnRewardedAdHiddenEvent"); LoggerUtils.Debug("[Max] OnRewardedAdHiddenEvent");
@ -192,7 +192,7 @@ namespace WZ
} }
} }
public void DisplayInterstitial(string ivPos, IvType _IvType = IvType.IV1, Action closeCallback = null) public void DisplayInterstitial(string ivPos, IvType _IvType = IvType.IV1, Action<double> closeCallback = null)
{ {
_ivPos = ivPos; _ivPos = ivPos;
_ivCloseCallback = closeCallback; _ivCloseCallback = closeCallback;
@ -226,7 +226,7 @@ namespace WZ
private void OnInterstitialAdFailedToDisplayEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo, MaxSdkBase.AdInfo arg3) private void OnInterstitialAdFailedToDisplayEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo, MaxSdkBase.AdInfo arg3)
{ {
LoggerUtils.Debug("[Max] OnInterstitialAdFailedToDisplayEvent :" + errorInfo.Message + " " + errorInfo.Code + " " + errorInfo.MediatedNetworkErrorMessage + " " + errorInfo.MediatedNetworkErrorCode); LoggerUtils.Debug("[Max] OnInterstitialAdFailedToDisplayEvent :" + errorInfo.Message + " " + errorInfo.Code + " " + errorInfo.MediatedNetworkErrorMessage + " " + errorInfo.MediatedNetworkErrorCode);
_ivCloseCallback?.Invoke(); _ivCloseCallback?.Invoke(0);
_ivCloseCallback = null; _ivCloseCallback = null;
LoadInterstitial(); LoadInterstitial();
AdsActionEvents.TrackAdFailToShow(Platfrom,AdsType.Interstitial,errorInfo.Message,""); AdsActionEvents.TrackAdFailToShow(Platfrom,AdsType.Interstitial,errorInfo.Message,"");
@ -242,7 +242,7 @@ namespace WZ
{ {
LoggerUtils.Debug($"[Max] OnInterstitialHiddenEvent"); LoggerUtils.Debug($"[Max] OnInterstitialHiddenEvent");
AdsActionEvents.TrackAdClosed(Platfrom,adInfo.NetworkName,adInfo.AdUnitIdentifier,AdsType.Interstitial,"",adInfo.Revenue); AdsActionEvents.TrackAdClosed(Platfrom,adInfo.NetworkName,adInfo.AdUnitIdentifier,AdsType.Interstitial,"",adInfo.Revenue);
_ivCloseCallback?.Invoke(); _ivCloseCallback?.Invoke(adInfo.Revenue);
_ivCloseCallback = null; _ivCloseCallback = null;
LoadInterstitial(); LoadInterstitial();
} }

View File

@ -19,8 +19,8 @@ namespace WZ
public string _topon_rewarded_units; public string _topon_rewarded_units;
private string _rvPos; private string _rvPos;
private string _ivPos; private string _ivPos;
private Action<bool> _rvCloseCallback = null; private Action<bool,double> _rvCloseCallback = null;
private Action _ivCloseCallback = null; private Action<double> _ivCloseCallback = null;
private Action _rvShowFailedCallback = null; private Action _rvShowFailedCallback = null;
public void Initialize() public void Initialize()
@ -60,7 +60,7 @@ namespace WZ
} }
public void LoadRewarded() { } public void LoadRewarded() { }
public void DisplayRewarded(string adPos, Action<bool> rewardCallback = null, Action showFailedCallback = null) public void DisplayRewarded(string adPos, Action<bool,double> rewardCallback = null, Action showFailedCallback = null)
{ {
_rvPos = adPos; _rvPos = adPos;
_rvCloseCallback = rewardCallback; _rvCloseCallback = rewardCallback;
@ -94,7 +94,7 @@ namespace WZ
public void LoadInterstitial() { } public void LoadInterstitial() { }
public double GetInterstitialRevenue() { return 0; } public double GetInterstitialRevenue() { return 0; }
public void DisplayInterstitial(string ivPos, IvType _IvType = IvType.IV1, Action closeCallback = null) public void DisplayInterstitial(string ivPos, IvType _IvType = IvType.IV1, Action<double> closeCallback = null)
{ {
_ivPos = ivPos; _ivPos = ivPos;
_ivCloseCallback = closeCallback; _ivCloseCallback = closeCallback;
@ -176,7 +176,7 @@ namespace WZ
} }
else if (erg.placementId.Equals(_topon_interstitial_units)) else if (erg.placementId.Equals(_topon_interstitial_units))
{ {
_ivCloseCallback?.Invoke(); _ivCloseCallback?.Invoke(0);
_ivCloseCallback = null; _ivCloseCallback = null;
} }
}, ""); }, "");
@ -198,12 +198,12 @@ namespace WZ
{ {
if (erg.placementId.Equals(_topon_rewarded_units)) if (erg.placementId.Equals(_topon_rewarded_units))
{ {
_rvCloseCallback?.Invoke(true); _rvCloseCallback?.Invoke(true,erg.callbackInfo.publisher_revenue);
_rvCloseCallback = null; _rvCloseCallback = null;
} }
else if (erg.placementId.Equals(_topon_interstitial_units)) else if (erg.placementId.Equals(_topon_interstitial_units))
{ {
_ivCloseCallback?.Invoke(); _ivCloseCallback?.Invoke(erg.callbackInfo.publisher_revenue);
_ivCloseCallback = null; _ivCloseCallback = null;
} }
}, ""); }, "");

View File

@ -46,13 +46,21 @@ public class AppSDKManager : D_MonoSingleton<AppSDKManager>
bool isInterstitialReady = AdsSDKManager.Instance.IsInterstitialReady(); bool isInterstitialReady = AdsSDKManager.Instance.IsInterstitialReady();
if (isInterstitialReady) if (isInterstitialReady)
{ {
AdsSDKManager.Instance.ShowInterstitialAd(position, ivadType, () => AdsSDKManager.Instance.ShowInterstitialAd(position, ivadType, (revenue) =>
{ {
//展示完一个插屏之后调用 //展示完一个插屏之后调用
IvRulesConst.CurrentOverLevel = 0; IvRulesConst.CurrentOverLevel = 0;
IvRulesConst.CurrentInterval = TimeUtils.GetLocalTimestamp(); IvRulesConst.CurrentInterval = TimeUtils.GetLocalTimestamp();
}); });
} }
else
{
callback?.Invoke(0);
}
}
else
{
callback?.Invoke(0);
} }
} }
@ -107,16 +115,17 @@ public class AppSDKManager : D_MonoSingleton<AppSDKManager>
public void ShowRewardAd(string position, Action<double> callback = null) public void ShowRewardAd(string position, Action<bool,double> callback = null)
{ {
bool isRewardAdReady = AdsSDKManager.Instance.IsRewardAdReady(); bool isRewardAdReady = AdsSDKManager.Instance.IsRewardAdReady();
if (isRewardAdReady) if (isRewardAdReady)
{ {
AdsSDKManager.Instance.ShowRewardAd(position, (isReward) => AdsSDKManager.Instance.ShowRewardAd(position, (isReward, revenue) =>
{ {
if (isReward) if (isReward)
{ {
//callback?.Invoke(); //callback?.Invoke();
callback?.Invoke(true, revenue);
} }
}); });
} }