修复kwai上报广告位ID问题
This commit is contained in:
parent
d5ec0e9ab1
commit
72be82d9f1
|
@ -244,16 +244,16 @@ namespace WZ
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 收益上报
|
#region 收益上报
|
||||||
public void TrackAdImpression(AdsType type)
|
public void TrackAdImpression(AdsType type,string adUnitId)
|
||||||
{
|
{
|
||||||
AdjustTrackEvent.Instance.TrackAdEvent(type == AdsType.Rewarded ? _rewardAdRevenue : _interstitiaAdRevenue,
|
AdjustTrackEvent.Instance.TrackAdEvent(type == AdsType.Rewarded ? _rewardAdRevenue : _interstitiaAdRevenue,
|
||||||
ClientName,
|
ClientName,
|
||||||
type == AdsType.Rewarded ? _rewardAdUnitId : _interstitialAdUnitId,
|
adUnitId,
|
||||||
type == AdsType.Rewarded ? _rewardAdUnitId : _interstitialAdUnitId);
|
adUnitId);
|
||||||
|
|
||||||
FireBaseAnalyticsManager.Instance.OnAdRevenueEvent(ClientName,
|
FireBaseAnalyticsManager.Instance.OnAdRevenueEvent(ClientName,
|
||||||
ClientName,
|
ClientName,
|
||||||
type == AdsType.Rewarded ? _rewardAdUnitId : _interstitialAdUnitId,
|
adUnitId,
|
||||||
type,
|
type,
|
||||||
type == AdsType.Rewarded ? _rewardAdRevenue : _interstitiaAdRevenue,
|
type == AdsType.Rewarded ? _rewardAdRevenue : _interstitiaAdRevenue,
|
||||||
type == AdsType.Rewarded ? _rvPos : _ivPos,
|
type == AdsType.Rewarded ? _rvPos : _ivPos,
|
||||||
|
@ -261,7 +261,7 @@ namespace WZ
|
||||||
|
|
||||||
ShuShuEvent.Instance.OnAdRevenueEvent(ClientName,
|
ShuShuEvent.Instance.OnAdRevenueEvent(ClientName,
|
||||||
ClientName,
|
ClientName,
|
||||||
type == AdsType.Rewarded ? _rewardAdUnitId : _interstitialAdUnitId,
|
adUnitId,
|
||||||
type.ToString(),
|
type.ToString(),
|
||||||
type == AdsType.Rewarded ? _rewardAdRevenue : _interstitiaAdRevenue,
|
type == AdsType.Rewarded ? _rewardAdRevenue : _interstitiaAdRevenue,
|
||||||
type == AdsType.Rewarded ? _rvPos : _ivPos,
|
type == AdsType.Rewarded ? _rvPos : _ivPos,
|
||||||
|
|
|
@ -156,7 +156,7 @@ namespace WZ
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理楼层广告加载成功
|
// 处理楼层广告加载成功
|
||||||
public void OnFloorAdLoaded(FloorConfig floor, IInterstitialAdController controller,double revenue)
|
public void OnFloorAdLoaded(FloorConfig floor, IInterstitialAdController controller, double revenue)
|
||||||
{
|
{
|
||||||
if (!_isRequestingFloors || _successfulFloor != null) return;
|
if (!_isRequestingFloors || _successfulFloor != null) return;
|
||||||
|
|
||||||
|
@ -190,11 +190,11 @@ namespace WZ
|
||||||
// 处理楼层广告加载失败
|
// 处理楼层广告加载失败
|
||||||
public void OnFloorAdFailed(FloorConfig floor, string error)
|
public void OnFloorAdFailed(FloorConfig floor, string error)
|
||||||
{
|
{
|
||||||
LoggerUtils.Debug($"[kwai] floor inter ad failed: {floor.id} with error: {error} _isRequestingFloors:{!_isRequestingFloors} _successfulFloor: {_successfulFloor != null}" );
|
LoggerUtils.Debug($"[kwai] floor inter ad failed: {floor.id} with error: {error} _isRequestingFloors:{!_isRequestingFloors} _successfulFloor: {_successfulFloor != null}");
|
||||||
if (!_isRequestingFloors || _successfulFloor != null) return;
|
if (!_isRequestingFloors || _successfulFloor != null) return;
|
||||||
|
|
||||||
// 移除失败floor
|
// 移除失败floor
|
||||||
if(_currentRequestBatch.Contains(floor))_currentRequestBatch.Remove(floor);
|
if (_currentRequestBatch.Contains(floor)) _currentRequestBatch.Remove(floor);
|
||||||
|
|
||||||
// 检查当前批次是否全部失败
|
// 检查当前批次是否全部失败
|
||||||
bool allFailedInBatch = true;
|
bool allFailedInBatch = true;
|
||||||
|
@ -275,6 +275,11 @@ namespace WZ
|
||||||
{
|
{
|
||||||
return Guid.NewGuid().ToString("N");
|
return Guid.NewGuid().ToString("N");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetSuccessfulFloorUnitId()
|
||||||
|
{
|
||||||
|
return _successfulFloor != null ? _successfulFloor.unite_id : "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ namespace WZ
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理楼层广告加载成功
|
// 处理楼层广告加载成功
|
||||||
public void OnFloorAdLoaded(FloorConfig floor, IRewardAdController controller,double revenue)
|
public void OnFloorAdLoaded(FloorConfig floor, IRewardAdController controller, double revenue)
|
||||||
{
|
{
|
||||||
if (!_isRequestingFloors || _successfulFloor != null) return;
|
if (!_isRequestingFloors || _successfulFloor != null) return;
|
||||||
|
|
||||||
|
@ -186,11 +186,11 @@ namespace WZ
|
||||||
// 处理楼层广告加载失败
|
// 处理楼层广告加载失败
|
||||||
public void OnFloorAdFailed(FloorConfig floor, string error)
|
public void OnFloorAdFailed(FloorConfig floor, string error)
|
||||||
{
|
{
|
||||||
LoggerUtils.Debug($"[kwai] floor reward ad failed: {floor.id} with error: {error} _isRequestingFloors:{!_isRequestingFloors} _successfulFloor: {_successfulFloor != null}" );
|
LoggerUtils.Debug($"[kwai] floor reward ad failed: {floor.id} with error: {error} _isRequestingFloors:{!_isRequestingFloors} _successfulFloor: {_successfulFloor != null}");
|
||||||
if (!_isRequestingFloors || _successfulFloor != null) return;
|
if (!_isRequestingFloors || _successfulFloor != null) return;
|
||||||
|
|
||||||
// 移除失败floor
|
// 移除失败floor
|
||||||
if(_currentRequestBatch.Contains(floor))_currentRequestBatch.Remove(floor);
|
if (_currentRequestBatch.Contains(floor)) _currentRequestBatch.Remove(floor);
|
||||||
|
|
||||||
// 检查当前批次是否全部失败
|
// 检查当前批次是否全部失败
|
||||||
bool allFailedInBatch = true;
|
bool allFailedInBatch = true;
|
||||||
|
@ -271,6 +271,11 @@ namespace WZ
|
||||||
{
|
{
|
||||||
return Guid.NewGuid().ToString("N");
|
return Guid.NewGuid().ToString("N");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetSuccessfulFloorUnitId()
|
||||||
|
{
|
||||||
|
return _successfulFloor != null ? _successfulFloor.unite_id : "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace WZ
|
||||||
{
|
{
|
||||||
AdsActionEvents.TrackAdClicked(KwaiAdsManager.Instance.Platfrom,
|
AdsActionEvents.TrackAdClicked(KwaiAdsManager.Instance.Platfrom,
|
||||||
KwaiAdsManager.Instance.ClientName,
|
KwaiAdsManager.Instance.ClientName,
|
||||||
KwaiAdsManager.Instance._interstitialAdUnitId,
|
KwaiFloorIvManager.Instance.GetSuccessfulFloorUnitId(),
|
||||||
AdsType.Interstitial,
|
AdsType.Interstitial,
|
||||||
KwaiAdsManager.Instance._ivPos,
|
KwaiAdsManager.Instance._ivPos,
|
||||||
KwaiAdsManager.Instance._interstitiaAdRevenue);
|
KwaiAdsManager.Instance._interstitiaAdRevenue);
|
||||||
|
@ -33,7 +33,7 @@ namespace WZ
|
||||||
{
|
{
|
||||||
AdsActionEvents.TrackAdClosed(KwaiAdsManager.Instance.Platfrom,
|
AdsActionEvents.TrackAdClosed(KwaiAdsManager.Instance.Platfrom,
|
||||||
KwaiAdsManager.Instance.ClientName,
|
KwaiAdsManager.Instance.ClientName,
|
||||||
KwaiAdsManager.Instance._interstitialAdUnitId,
|
KwaiFloorIvManager.Instance.GetSuccessfulFloorUnitId(),
|
||||||
AdsType.Interstitial,
|
AdsType.Interstitial,
|
||||||
KwaiAdsManager.Instance._ivPos,
|
KwaiAdsManager.Instance._ivPos,
|
||||||
KwaiAdsManager.Instance._interstitiaAdRevenue);
|
KwaiAdsManager.Instance._interstitiaAdRevenue);
|
||||||
|
@ -50,7 +50,7 @@ namespace WZ
|
||||||
|
|
||||||
public void OnAdShow()
|
public void OnAdShow()
|
||||||
{
|
{
|
||||||
KwaiAdsManager.Instance.TrackAdImpression(AdsType.Interstitial);
|
KwaiAdsManager.Instance.TrackAdImpression(AdsType.Interstitial,KwaiFloorIvManager.Instance.GetSuccessfulFloorUnitId());
|
||||||
LoggerUtils.Debug("[kwai] floor inter OnAdShow");
|
LoggerUtils.Debug("[kwai] floor inter OnAdShow");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace WZ
|
||||||
public void OnAdShow()
|
public void OnAdShow()
|
||||||
{
|
{
|
||||||
// 插页视频曝光 | Interstitial video show
|
// 插页视频曝光 | Interstitial video show
|
||||||
KwaiAdsManager.Instance.TrackAdImpression(AdsType.Interstitial);
|
KwaiAdsManager.Instance.TrackAdImpression(AdsType.Interstitial,KwaiAdsManager.Instance._interstitialAdUnitId);
|
||||||
LoggerUtils.Debug("[kwai] InterstitialAdListener#OnAdShow");
|
LoggerUtils.Debug("[kwai] InterstitialAdListener#OnAdShow");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace WZ
|
||||||
{
|
{
|
||||||
AdsActionEvents.TrackAdClicked(KwaiAdsManager.Instance.Platfrom,
|
AdsActionEvents.TrackAdClicked(KwaiAdsManager.Instance.Platfrom,
|
||||||
KwaiAdsManager.Instance.ClientName,
|
KwaiAdsManager.Instance.ClientName,
|
||||||
KwaiAdsManager.Instance._rewardAdUnitId,
|
KwaiFloorRvManager.Instance.GetSuccessfulFloorUnitId(),
|
||||||
AdsType.Rewarded,
|
AdsType.Rewarded,
|
||||||
KwaiAdsManager.Instance._rvPos,
|
KwaiAdsManager.Instance._rvPos,
|
||||||
KwaiAdsManager.Instance._rewardAdRevenue);
|
KwaiAdsManager.Instance._rewardAdRevenue);
|
||||||
|
@ -34,7 +34,7 @@ namespace WZ
|
||||||
{
|
{
|
||||||
AdsActionEvents.TrackAdClosed(KwaiAdsManager.Instance.Platfrom,
|
AdsActionEvents.TrackAdClosed(KwaiAdsManager.Instance.Platfrom,
|
||||||
KwaiAdsManager.Instance.ClientName,
|
KwaiAdsManager.Instance.ClientName,
|
||||||
KwaiAdsManager.Instance._rewardAdUnitId,
|
KwaiFloorRvManager.Instance.GetSuccessfulFloorUnitId(),
|
||||||
AdsType.Rewarded,
|
AdsType.Rewarded,
|
||||||
KwaiAdsManager.Instance._rvPos,
|
KwaiAdsManager.Instance._rvPos,
|
||||||
KwaiAdsManager.Instance._rewardAdRevenue);
|
KwaiAdsManager.Instance._rewardAdRevenue);
|
||||||
|
@ -53,7 +53,7 @@ namespace WZ
|
||||||
|
|
||||||
public void OnAdShow()
|
public void OnAdShow()
|
||||||
{
|
{
|
||||||
KwaiAdsManager.Instance.TrackAdImpression(AdsType.Rewarded);
|
KwaiAdsManager.Instance.TrackAdImpression(AdsType.Rewarded,KwaiFloorRvManager.Instance.GetSuccessfulFloorUnitId());
|
||||||
LoggerUtils.Debug("[kwai] floor reward RewardAdListener#OnAdShow");
|
LoggerUtils.Debug("[kwai] floor reward RewardAdListener#OnAdShow");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace WZ
|
||||||
public void OnAdShow()
|
public void OnAdShow()
|
||||||
{
|
{
|
||||||
// 激励视频曝光 | Reward video show
|
// 激励视频曝光 | Reward video show
|
||||||
KwaiAdsManager.Instance.TrackAdImpression(AdsType.Rewarded);
|
KwaiAdsManager.Instance.TrackAdImpression(AdsType.Rewarded,KwaiAdsManager.Instance._rewardAdUnitId);
|
||||||
LoggerUtils.Debug("[kwai] RewardAdListener#OnAdShow");
|
LoggerUtils.Debug("[kwai] RewardAdListener#OnAdShow");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||||
using AnyThinkAds.Api;
|
using AnyThinkAds.Api;
|
||||||
using GoogleMobileAds.Api;
|
using GoogleMobileAds.Api;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.Purchasing;
|
||||||
using WZ;
|
using WZ;
|
||||||
|
|
||||||
public class Test : MonoBehaviour
|
public class Test : MonoBehaviour
|
||||||
|
@ -17,6 +18,18 @@ public class Test : MonoBehaviour
|
||||||
{
|
{
|
||||||
small = gameObject.transform.Find("NativeAd-small").GetComponent<RectTransform>();
|
small = gameObject.transform.Find("NativeAd-small").GetComponent<RectTransform>();
|
||||||
medium = gameObject.transform.Find("NativeAd-medium").GetComponent<RectTransform>();
|
medium = gameObject.transform.Find("NativeAd-medium").GetComponent<RectTransform>();
|
||||||
|
RushSDKManager.Instance.RegisterPurchaseCompletionHandler((info)=>
|
||||||
|
{
|
||||||
|
LoggerUtils.Debug("[iap] result ->" + info.ToJson());
|
||||||
|
if (info.purchaseResult == true || info.orderAlreadyExists == true)
|
||||||
|
{
|
||||||
|
RushSDKManager.Instance.LogCheckingOrder(info.productName,info.productID,info.orderID,info.gameExtra,info.gameExtra);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
RushSDKManager.Instance.AddProductsStatic(new Dictionary<string, UnityEngine.Purchasing.ProductType>()
|
||||||
|
{
|
||||||
|
{ "com.tilematch.1000gold", ProductType.Consumable }
|
||||||
|
});
|
||||||
RushSDKManager.Instance.SetUserSourceListener((bool success, string source) =>
|
RushSDKManager.Instance.SetUserSourceListener((bool success, string source) =>
|
||||||
{
|
{
|
||||||
LoggerUtils.Debug("adjust callback: "+success+" adnetwork:"+source);
|
LoggerUtils.Debug("adjust callback: "+success+" adnetwork:"+source);
|
||||||
|
@ -34,7 +47,8 @@ public class Test : MonoBehaviour
|
||||||
// {
|
// {
|
||||||
// LoggerUtils.Debug("[kwai] OnRewardedVideoAdShowed revenue:"+revenue+"+ state:"+state);
|
// LoggerUtils.Debug("[kwai] OnRewardedVideoAdShowed revenue:"+revenue+"+ state:"+state);
|
||||||
// });
|
// });
|
||||||
RushSDKManager.Instance.ShowBanner(BannerType.Standard,BannerAlignType.CenterTop);
|
// RushSDKManager.Instance.ShowBanner(BannerType.Standard,BannerAlignType.CenterTop);
|
||||||
|
RushSDKManager.Instance.PurchaseProductById("com.tilematch.1000gold","1000gold");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnShowInterstitial()
|
public void OnShowInterstitial()
|
||||||
|
|
Loading…
Reference in New Issue