update:新增 INTER 和 RV 广告关闭的回调参数
--story=1020788 --user=yufei.hu 【中台】【SDK】新增INTER 和 RV 广告关闭的回调参数 https://www.tapd.cn/33527076/s/1154205 Signed-off-by: huyufei <yufei.hu@castbox.fm>main
							parent
							
								
									dc47cec8bd
								
							
						
					
					
						commit
						fe691235d6
					
				|  | @ -93,6 +93,7 @@ namespace Guru | |||
|             // 初始化Amazon | ||||
|             Amazon.Initialize (AmazonAppID); | ||||
|             Amazon.SetAdNetworkInfo(new AdNetworkInfo(DTBAdNetwork.MAX)); | ||||
|             Debug.Log($"[Ads] --- Amazon init start isDebug:{isDebug},    AmazonID:{AmazonAppID}"); | ||||
|             Amazon.EnableTesting (isDebug); // Make sure to take this off when going live. | ||||
|             Amazon.EnableLogging (isDebug); | ||||
| 		 | ||||
|  |  | |||
|  | @ -32,10 +32,12 @@ namespace Guru | |||
|         public static Action<string> OnInterstitialStartLoad; | ||||
|         public static Action OnInterstitialLoaded; | ||||
|         public static Action OnInterstitialFailed; | ||||
|         public static Action OnInterstitialClosed; | ||||
| 
 | ||||
|         public static Action<string> OnRewardedStartLoad; | ||||
|         public static Action OnRewardLoaded; | ||||
|         public static Action OnRewardFailed; | ||||
|         public static Action OnRewardClosed; | ||||
| 
 | ||||
|         protected AdsModel _model; | ||||
|         protected AdsInitSpec _initSpec = null; | ||||
|  | @ -426,7 +428,7 @@ namespace Guru | |||
|         private string _iadsCategory = "main"; | ||||
|         private int _interstitialRetryAttempt; | ||||
|         protected float _iadsLoadStartTime; | ||||
|         private Action _interstitialDismissAction; | ||||
|         private Action _interCloseAction; | ||||
|         protected bool _isIadsLoading = false; | ||||
|         public bool IsIadsLoading => _isIadsLoading; | ||||
| 
 | ||||
|  | @ -482,7 +484,7 @@ namespace Guru | |||
|             } | ||||
| 
 | ||||
|             _iadsCategory = category; | ||||
|             _interstitialDismissAction = dismissAction; | ||||
|             _interCloseAction = dismissAction; | ||||
|             MaxSdk.ShowInterstitial(GetInterstitialID()); | ||||
| 
 | ||||
|             // RequestInterstitialAD(); // 直接加载下一个广告 | ||||
|  | @ -549,7 +551,8 @@ namespace Guru | |||
|         protected virtual void OnInterstitialDismissedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo) | ||||
|         { | ||||
|             // Interstitial ad is hidden. Pre-load the next ad | ||||
|             _interstitialDismissAction?.Invoke(); | ||||
|             _interCloseAction?.Invoke(); | ||||
|             OnInterstitialClosed?.Invoke(); | ||||
|             // Analytics.ADIadsClose(adUnitId, _iadsCategory); | ||||
|             Analytics.ADIadsClose(AdParams.Build(adUnitId, category: _iadsCategory)); | ||||
|             //延时加载下一个广告 | ||||
|  | @ -563,9 +566,9 @@ namespace Guru | |||
|         private string _rewardCategory = "main"; | ||||
|         private int _rewardRetryAttempt; | ||||
|         protected float _radsLoadStartTime; | ||||
|         private Action _rewardAction; | ||||
|         private Action<string> _failAction; | ||||
|         private Action _dismissAction; | ||||
|         private Action _rvRewardAction; | ||||
|         private Action<string> _rvFailAction; | ||||
|         private Action _rvDismissAction; | ||||
|         protected bool _isRadsLoading = false; | ||||
|         public bool IsRadsLoading => _isRadsLoading; | ||||
| 
 | ||||
|  | @ -629,9 +632,9 @@ namespace Guru | |||
|             } | ||||
| 
 | ||||
|             _rewardCategory = category; | ||||
|             _rewardAction = rewardAction; | ||||
|             _failAction = failAction; | ||||
|             _dismissAction = dismissAction; | ||||
|             _rvRewardAction = rewardAction; | ||||
|             _rvFailAction = failAction; | ||||
|             _rvDismissAction = dismissAction; | ||||
|             MaxSdk.ShowRewardedAd(GetRewardedID()); | ||||
| 
 | ||||
|             // RequestRewardedAD(); | ||||
|  | @ -683,7 +686,7 @@ namespace Guru | |||
|                 duration: GetAdsLoadDuration(ref _radsLoadStartTime), category: _rewardCategory, | ||||
|                 errorCode: (int)errorInfo.Code, | ||||
|                 waterfallName: errorInfo?.WaterfallInfo?.Name ?? "")); | ||||
|             _failAction?.Invoke("OnRewardedAdFailedToDisplayEvent"); | ||||
|             _rvFailAction?.Invoke("OnRewardedAdFailedToDisplayEvent"); | ||||
|             DelayCall(2.0f, RequestRewardedAD); | ||||
| 
 | ||||
|             OnRewardFailed?.Invoke(); | ||||
|  | @ -706,11 +709,17 @@ namespace Guru | |||
|         protected virtual void OnRewardedAdDismissedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo) | ||||
|         { | ||||
|             this.Log("OnRewardedAdDismissedEvent"); | ||||
|              | ||||
|             _rvDismissAction?.Invoke(); | ||||
|             OnRewardClosed?.Invoke(); | ||||
|              | ||||
|             // Analytics.ADRadsClose(adUnitId, _rewardCategory); | ||||
|             Analytics.ADRadsClose(AdParams.Build(adUnitId, category: _rewardCategory)); | ||||
|             _dismissAction?.Invoke(); | ||||
|              | ||||
|             //延时加载下一个广告 | ||||
|             DelayCall(2.0f, RequestRewardedAD); | ||||
|              | ||||
|              | ||||
|         } | ||||
| 
 | ||||
|         protected virtual void OnRewardedAdReceivedRewardEvent(string adUnitId, MaxSdk.Reward reward, | ||||
|  | @ -720,7 +729,7 @@ namespace Guru | |||
|             // Analytics.ADRadsRewarded(adUnitId, _rewardCategory); | ||||
|             Analytics.ADRadsRewarded(AdParams.Build(adUnitId, category: _rewardCategory)); | ||||
|             // Rewarded ad was displayed and user should receive the reward | ||||
|             _rewardAction?.Invoke(); | ||||
|             _rvRewardAction?.Invoke(); | ||||
|         } | ||||
| 
 | ||||
|         #endregion | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue