获取激励、插屏、全屏Native广告价值
This commit is contained in:
parent
64d510cccb
commit
ee47d9ce78
|
@ -325,7 +325,7 @@ namespace WZ
|
|||
|
||||
public double GetNativeRevenue(string adUnitId)
|
||||
{
|
||||
return _admobNativeAdManager.GetHighestPayingAdRevenue();
|
||||
return _admobNativeAdManager.GetAdRevenue(adUnitId);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -222,6 +222,19 @@ namespace WZ
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 获取广告收益信息
|
||||
public double GetAdRevenue(string adUnit)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(adUnit) &&
|
||||
_adRevenueCache.TryGetValue(adUnit, out var revenue))
|
||||
{
|
||||
return revenue;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
// 清理资源
|
||||
public void Destroy()
|
||||
|
|
|
@ -12,15 +12,6 @@ namespace WZ
|
|||
private List<IAdService> _adNetworks = new List<IAdService>();
|
||||
// 是否有激励视频或者插屏广告在展示
|
||||
public bool otherAdsOnShow = false;
|
||||
/// <summary>
|
||||
/// 看完广告的回调
|
||||
/// </summary>
|
||||
private Action<double> AdRewardCallback;
|
||||
|
||||
/// <summary>
|
||||
/// 广告竞价开关:激励、插屏、全屏Native广告竞价
|
||||
/// </summary>
|
||||
public bool IsMoreAdsBidding = false;
|
||||
|
||||
public Action OnSplashAdCloseCallback;
|
||||
|
||||
|
@ -100,6 +91,45 @@ namespace WZ
|
|||
AdjustTrackEvent.Instance.TrackEventName("RV_Show", new Dictionary<string, object>());
|
||||
CheckAndRefreshExpiredBids(AdsType.Rewarded);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取激励广告价值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public double GetRewardedAdRevenue()
|
||||
{
|
||||
if (!IsRewardAdReady())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
PlatformType result = GetBestPlatformType(false);
|
||||
if (result == PlatformType.AppLovin)
|
||||
{
|
||||
return MaxAdsManager.Instance.GetRewardedRevenue();
|
||||
}
|
||||
else if (result == PlatformType.Admob)
|
||||
{
|
||||
return AdmobAdsManager.Instance.GetRewardedRevenue();
|
||||
}
|
||||
else if (result == PlatformType.Bigo)
|
||||
{
|
||||
return BigoAdsManager.Instance.GetRewardedRevenue();
|
||||
}
|
||||
else if (result == PlatformType.Topon)
|
||||
{
|
||||
return TpnAdsManager.Instance.GetRewardedRevenue();
|
||||
}
|
||||
else if (result == PlatformType.Kwai)
|
||||
{
|
||||
return KwaiAdsManager.Instance.GetRewardedRevenue();
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 插屏广告
|
||||
|
@ -147,6 +177,46 @@ namespace WZ
|
|||
// 刷新其他类型广告
|
||||
CheckAndRefreshExpiredBids(AdsType.Interstitial);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取插屏广告价值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public double GetInterstitialAdRevenue()
|
||||
{
|
||||
if (!IsInterstitialReady())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
PlatformType result = GetBestPlatformType(true);
|
||||
if (result == PlatformType.AppLovin)
|
||||
{
|
||||
return MaxAdsManager.Instance.GetInterstitialRevenue();
|
||||
}
|
||||
else if (result == PlatformType.Admob)
|
||||
{
|
||||
return AdmobAdsManager.Instance.GetInterstitialRevenue();
|
||||
}
|
||||
else if (result == PlatformType.Bigo)
|
||||
{
|
||||
return BigoAdsManager.Instance.GetInterstitialRevenue();
|
||||
}
|
||||
else if (result == PlatformType.Topon)
|
||||
{
|
||||
return TpnAdsManager.Instance.GetInterstitialRevenue();
|
||||
}
|
||||
else if (result == PlatformType.Kwai)
|
||||
{
|
||||
return KwaiAdsManager.Instance.GetInterstitialRevenue();
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 横幅广告
|
||||
|
@ -188,6 +258,16 @@ namespace WZ
|
|||
{
|
||||
AdmobAdsManager.Instance.RemoveNative(adUnitId);
|
||||
}
|
||||
|
||||
public double GetNativeAdRevenue(string adUnitId)
|
||||
{
|
||||
if (!IsNativeAdReady(adUnitId))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return AdmobAdsManager.Instance.GetNativeRevenue(adUnitId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 开屏广告
|
||||
|
|
|
@ -14,7 +14,7 @@ using WZ;
|
|||
|
||||
public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
||||
{
|
||||
public void Init(Action action, bool showLog)
|
||||
public void InitializeSdk(Action action, bool showLog)
|
||||
{
|
||||
LoggerUtils.Enabled = showLog;
|
||||
FileParse.Parse();
|
||||
|
@ -81,6 +81,20 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取激励广告价值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public double GetRewardedAdRevenue()
|
||||
{
|
||||
if (!IsRewardedAdReady())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return AdsSDKManager.Instance.GetRewardedAdRevenue();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否已缓存插屏
|
||||
/// </summary>
|
||||
|
@ -127,6 +141,20 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
callback?.Invoke(-1);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取激励广告价值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public double GetInterstitialAdRevenue()
|
||||
{
|
||||
if (!IsInterstitialAdReady())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return AdsSDKManager.Instance.GetInterstitialAdRevenue();
|
||||
}
|
||||
|
||||
public void ShowBanner()
|
||||
{
|
||||
|
@ -171,6 +199,21 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
|
||||
AdsSDKManager.Instance.ShowNativeAd(position, adUnitId, nativeAdPosition);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取激励广告价值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public double GetFullNativeRevenue()
|
||||
{
|
||||
if (!IsNativeFullReady())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
var adUnitId = StaticValue.AdmobFullNativeId;
|
||||
return AdsSDKManager.Instance.GetNativeAdRevenue(adUnitId);
|
||||
}
|
||||
|
||||
public void HideFullNative()
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ public class Test : MonoBehaviour
|
|||
|
||||
public void OnShowAd()
|
||||
{
|
||||
RushSDKManager.Instance.Init(null, true);
|
||||
RushSDKManager.Instance.InitializeSdk(null, true);
|
||||
// KwaiAdsManager.Instance.ShowRewardAd();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue