Merge branch 'main' of http://v4.9ms.co:7777/yufeng/SDK_UnityMoney
This commit is contained in:
commit
b305fd3ab8
|
@ -148,7 +148,7 @@ namespace WZ
|
|||
#region 插页广告功能
|
||||
public void LoadInterstitial()
|
||||
{
|
||||
_admobBannerAdManager?.Destroy();
|
||||
_admobInterstitialAdManager?.Destroy();
|
||||
_admobInterstitialAdManager = new AdmobInterstitialAdManager();
|
||||
_admobInterstitialAdManager.InitializeAdUnits(
|
||||
_interstitialAdUnits,
|
||||
|
@ -245,7 +245,7 @@ namespace WZ
|
|||
public bool IsSplashAvailable()
|
||||
{
|
||||
if (!_initialized) return false;
|
||||
return _admobBannerAdManager.GetAvailableAdUnits().Count > 0;
|
||||
return _admobSplashAdManager.GetAvailableAdUnits().Count > 0;
|
||||
}
|
||||
public void DisplaySplash()
|
||||
{
|
||||
|
@ -324,7 +324,7 @@ namespace WZ
|
|||
|
||||
public double GetNativeRevenue(string adUnitId)
|
||||
{
|
||||
return _admobBannerAdManager.GetAdRevenue(adUnitId);
|
||||
return _admobNativeAdManager.GetHighestPayingAdRevenue();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -17,11 +17,11 @@ namespace WZ
|
|||
{
|
||||
string responseInfoJson = responseInfo.ToString();
|
||||
JObject responseInfoObj = JObject.Parse(responseInfoJson);
|
||||
JToken loadedAdapterResponse = responseInfoObj["Response Extras"];
|
||||
JToken loadedAdapterResponse = responseInfoObj["Adapter Responses"];
|
||||
|
||||
if (loadedAdapterResponse != null)
|
||||
{
|
||||
pubid = loadedAdapterResponse["mediation_group_name"]?.ToString();
|
||||
pubid = loadedAdapterResponse["Credentials"]?.ToString();
|
||||
}
|
||||
}
|
||||
catch
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace WZ
|
|||
_showFailedCallback?.Invoke();
|
||||
return;
|
||||
}
|
||||
AdsSDKManager.Instance.otherAdsOnShow = true;
|
||||
otherAdsOnShow = true;
|
||||
PlatformType result = GetBestPlatformType(false);
|
||||
BidPlatformManager.Instance.RecordBidSuccess(result, AdsType.Rewarded);
|
||||
if (result == PlatformType.AppLovin)
|
||||
|
@ -222,7 +222,6 @@ namespace WZ
|
|||
{
|
||||
if (isInterstitial)
|
||||
{
|
||||
LoggerUtils.Debug("yangwu max price");
|
||||
AdPriceInfo priceInfo = new AdPriceInfo(
|
||||
maxPrice: MaxAdsManager.Instance.GetInterstitialRevenue(),
|
||||
admobPrice: AdmobAdsManager.Instance.GetInterstitialRevenue(),
|
||||
|
|
|
@ -113,7 +113,7 @@ namespace WZ
|
|||
|
||||
public bool IsRewardedAvailable()
|
||||
{
|
||||
if (!_initialized) return false;
|
||||
if (!_initialized || _rewardedAdManager == null) return false;
|
||||
return _rewardedAdManager.GetAvailableAdUnits().Count > 0;
|
||||
}
|
||||
|
||||
|
@ -127,6 +127,7 @@ namespace WZ
|
|||
|
||||
public double GetRewardedRevenue()
|
||||
{
|
||||
if (!_initialized || _rewardedAdManager == null) return -1;
|
||||
return _rewardedAdManager.GetHighestPayingAdRevenue();
|
||||
}
|
||||
|
||||
|
@ -190,7 +191,7 @@ namespace WZ
|
|||
|
||||
public bool IsInterstitialAvailable()
|
||||
{
|
||||
if (!_initialized) return false;
|
||||
if (!_initialized || _interstitialAdManager == null) return false;
|
||||
return _interstitialAdManager.GetAvailableAdUnits().Count > 0;
|
||||
}
|
||||
|
||||
|
@ -203,6 +204,7 @@ namespace WZ
|
|||
|
||||
public double GetInterstitialRevenue()
|
||||
{
|
||||
if (!_initialized || _interstitialAdManager == null) return -1;
|
||||
return _interstitialAdManager.GetHighestPayingAdRevenue();
|
||||
}
|
||||
#endregion
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace WZ
|
|||
private static object m_kwaiObj = "m_kwaiObj";
|
||||
public static PlatformType GetPlatformType(AdPriceInfo priceInfo)
|
||||
{
|
||||
#if UNITY_ANDROID && UNITY_EDITOR
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
{
|
||||
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace WZ
|
|||
/// </summary>
|
||||
public class FireBaseAnalyticsManager : D_MonoSingleton<FireBaseAnalyticsManager>
|
||||
{
|
||||
|
||||
private const string KEY_SUPER_PROPERTIES = "KEY_SUPER_PROPERTIES";
|
||||
|
||||
private Dictionary<string, object> superProperties = new Dictionary<string, object>();
|
||||
|
@ -28,6 +29,7 @@ namespace WZ
|
|||
|
||||
public void LogEvent(string eventName)
|
||||
{
|
||||
if (!FireBaseRemoteConfigManager.Instance.IsInitialized) return;
|
||||
var superProperties = GetSuperProperties();
|
||||
if (superProperties.Count > 0)
|
||||
{
|
||||
|
@ -41,6 +43,7 @@ namespace WZ
|
|||
|
||||
public void LogEvent(string eventName, string key1, object value1)
|
||||
{
|
||||
if (!FireBaseRemoteConfigManager.Instance.IsInitialized) return;
|
||||
List<Parameter> parameters = new List<Parameter>();
|
||||
parameters.Add(GetParameter(key1, value1));
|
||||
|
||||
|
@ -54,6 +57,7 @@ namespace WZ
|
|||
|
||||
public void LogEvent(string eventName, Dictionary<string, object> dict)
|
||||
{
|
||||
if (!FireBaseRemoteConfigManager.Instance.IsInitialized) return;
|
||||
List<Parameter> parameters = new List<Parameter>();
|
||||
foreach (var item in dict)
|
||||
{
|
||||
|
@ -72,6 +76,7 @@ namespace WZ
|
|||
|
||||
public void LogEvent(string eventName, Dictionary<string, string> dict)
|
||||
{
|
||||
if (!FireBaseRemoteConfigManager.Instance.IsInitialized) return;
|
||||
List<Parameter> parameters = new List<Parameter>();
|
||||
foreach (var item in dict)
|
||||
{
|
||||
|
@ -162,6 +167,7 @@ namespace WZ
|
|||
/// <param name="number">第几次展示该格式的广告</param>
|
||||
public void OnAdRevenueEvent(string ad_platform, string ad_source, string ad_unit_name, AdsType ad_format, double revenue, string position, int number)
|
||||
{
|
||||
if (!FireBaseRemoteConfigManager.Instance.IsInitialized) return;
|
||||
var impressionParameters = new[] {
|
||||
new Firebase.Analytics.Parameter("ad_platform", ad_platform),
|
||||
new Firebase.Analytics.Parameter("ad_source", ad_source),
|
||||
|
|
|
@ -8,6 +8,7 @@ namespace WZ
|
|||
{
|
||||
public class FireBaseRemoteConfigManager : D_MonoSingleton<FireBaseRemoteConfigManager>
|
||||
{
|
||||
public bool IsInitialized { get; private set; } = false;
|
||||
public void FetchRemoteConfig()
|
||||
{
|
||||
// Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
|
||||
|
@ -18,6 +19,7 @@ namespace WZ
|
|||
{
|
||||
FirebaseRemoteConfig.DefaultInstance.ActivateAsync().ContinueWithOnMainThread(task =>
|
||||
{
|
||||
IsInitialized = true;
|
||||
AdjustTrackEvent.Instance.UpdateEventToken();
|
||||
// 获取广告位信息
|
||||
AdConfigParser.Parse(GetRemoteConfigString("ad_config"));
|
||||
|
|
Loading…
Reference in New Issue