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 插页广告功能
|
#region 插页广告功能
|
||||||
public void LoadInterstitial()
|
public void LoadInterstitial()
|
||||||
{
|
{
|
||||||
_admobBannerAdManager?.Destroy();
|
_admobInterstitialAdManager?.Destroy();
|
||||||
_admobInterstitialAdManager = new AdmobInterstitialAdManager();
|
_admobInterstitialAdManager = new AdmobInterstitialAdManager();
|
||||||
_admobInterstitialAdManager.InitializeAdUnits(
|
_admobInterstitialAdManager.InitializeAdUnits(
|
||||||
_interstitialAdUnits,
|
_interstitialAdUnits,
|
||||||
|
@ -245,7 +245,7 @@ namespace WZ
|
||||||
public bool IsSplashAvailable()
|
public bool IsSplashAvailable()
|
||||||
{
|
{
|
||||||
if (!_initialized) return false;
|
if (!_initialized) return false;
|
||||||
return _admobBannerAdManager.GetAvailableAdUnits().Count > 0;
|
return _admobSplashAdManager.GetAvailableAdUnits().Count > 0;
|
||||||
}
|
}
|
||||||
public void DisplaySplash()
|
public void DisplaySplash()
|
||||||
{
|
{
|
||||||
|
@ -324,7 +324,7 @@ namespace WZ
|
||||||
|
|
||||||
public double GetNativeRevenue(string adUnitId)
|
public double GetNativeRevenue(string adUnitId)
|
||||||
{
|
{
|
||||||
return _admobBannerAdManager.GetAdRevenue(adUnitId);
|
return _admobNativeAdManager.GetHighestPayingAdRevenue();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -17,11 +17,11 @@ namespace WZ
|
||||||
{
|
{
|
||||||
string responseInfoJson = responseInfo.ToString();
|
string responseInfoJson = responseInfo.ToString();
|
||||||
JObject responseInfoObj = JObject.Parse(responseInfoJson);
|
JObject responseInfoObj = JObject.Parse(responseInfoJson);
|
||||||
JToken loadedAdapterResponse = responseInfoObj["Response Extras"];
|
JToken loadedAdapterResponse = responseInfoObj["Adapter Responses"];
|
||||||
|
|
||||||
if (loadedAdapterResponse != null)
|
if (loadedAdapterResponse != null)
|
||||||
{
|
{
|
||||||
pubid = loadedAdapterResponse["mediation_group_name"]?.ToString();
|
pubid = loadedAdapterResponse["Credentials"]?.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace WZ
|
||||||
_showFailedCallback?.Invoke();
|
_showFailedCallback?.Invoke();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AdsSDKManager.Instance.otherAdsOnShow = true;
|
otherAdsOnShow = true;
|
||||||
PlatformType result = GetBestPlatformType(false);
|
PlatformType result = GetBestPlatformType(false);
|
||||||
BidPlatformManager.Instance.RecordBidSuccess(result, AdsType.Rewarded);
|
BidPlatformManager.Instance.RecordBidSuccess(result, AdsType.Rewarded);
|
||||||
if (result == PlatformType.AppLovin)
|
if (result == PlatformType.AppLovin)
|
||||||
|
@ -222,7 +222,6 @@ namespace WZ
|
||||||
{
|
{
|
||||||
if (isInterstitial)
|
if (isInterstitial)
|
||||||
{
|
{
|
||||||
LoggerUtils.Debug("yangwu max price");
|
|
||||||
AdPriceInfo priceInfo = new AdPriceInfo(
|
AdPriceInfo priceInfo = new AdPriceInfo(
|
||||||
maxPrice: MaxAdsManager.Instance.GetInterstitialRevenue(),
|
maxPrice: MaxAdsManager.Instance.GetInterstitialRevenue(),
|
||||||
admobPrice: AdmobAdsManager.Instance.GetInterstitialRevenue(),
|
admobPrice: AdmobAdsManager.Instance.GetInterstitialRevenue(),
|
||||||
|
|
|
@ -113,7 +113,7 @@ namespace WZ
|
||||||
|
|
||||||
public bool IsRewardedAvailable()
|
public bool IsRewardedAvailable()
|
||||||
{
|
{
|
||||||
if (!_initialized) return false;
|
if (!_initialized || _rewardedAdManager == null) return false;
|
||||||
return _rewardedAdManager.GetAvailableAdUnits().Count > 0;
|
return _rewardedAdManager.GetAvailableAdUnits().Count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,6 +127,7 @@ namespace WZ
|
||||||
|
|
||||||
public double GetRewardedRevenue()
|
public double GetRewardedRevenue()
|
||||||
{
|
{
|
||||||
|
if (!_initialized || _rewardedAdManager == null) return -1;
|
||||||
return _rewardedAdManager.GetHighestPayingAdRevenue();
|
return _rewardedAdManager.GetHighestPayingAdRevenue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +191,7 @@ namespace WZ
|
||||||
|
|
||||||
public bool IsInterstitialAvailable()
|
public bool IsInterstitialAvailable()
|
||||||
{
|
{
|
||||||
if (!_initialized) return false;
|
if (!_initialized || _interstitialAdManager == null) return false;
|
||||||
return _interstitialAdManager.GetAvailableAdUnits().Count > 0;
|
return _interstitialAdManager.GetAvailableAdUnits().Count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,6 +204,7 @@ namespace WZ
|
||||||
|
|
||||||
public double GetInterstitialRevenue()
|
public double GetInterstitialRevenue()
|
||||||
{
|
{
|
||||||
|
if (!_initialized || _interstitialAdManager == null) return -1;
|
||||||
return _interstitialAdManager.GetHighestPayingAdRevenue();
|
return _interstitialAdManager.GetHighestPayingAdRevenue();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace WZ
|
||||||
private static object m_kwaiObj = "m_kwaiObj";
|
private static object m_kwaiObj = "m_kwaiObj";
|
||||||
public static PlatformType GetPlatformType(AdPriceInfo priceInfo)
|
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"))
|
using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||||
{
|
{
|
||||||
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
|
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace WZ
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class FireBaseAnalyticsManager : D_MonoSingleton<FireBaseAnalyticsManager>
|
public class FireBaseAnalyticsManager : D_MonoSingleton<FireBaseAnalyticsManager>
|
||||||
{
|
{
|
||||||
|
|
||||||
private const string KEY_SUPER_PROPERTIES = "KEY_SUPER_PROPERTIES";
|
private const string KEY_SUPER_PROPERTIES = "KEY_SUPER_PROPERTIES";
|
||||||
|
|
||||||
private Dictionary<string, object> superProperties = new Dictionary<string, object>();
|
private Dictionary<string, object> superProperties = new Dictionary<string, object>();
|
||||||
|
@ -28,6 +29,7 @@ namespace WZ
|
||||||
|
|
||||||
public void LogEvent(string eventName)
|
public void LogEvent(string eventName)
|
||||||
{
|
{
|
||||||
|
if (!FireBaseRemoteConfigManager.Instance.IsInitialized) return;
|
||||||
var superProperties = GetSuperProperties();
|
var superProperties = GetSuperProperties();
|
||||||
if (superProperties.Count > 0)
|
if (superProperties.Count > 0)
|
||||||
{
|
{
|
||||||
|
@ -41,6 +43,7 @@ namespace WZ
|
||||||
|
|
||||||
public void LogEvent(string eventName, string key1, object value1)
|
public void LogEvent(string eventName, string key1, object value1)
|
||||||
{
|
{
|
||||||
|
if (!FireBaseRemoteConfigManager.Instance.IsInitialized) return;
|
||||||
List<Parameter> parameters = new List<Parameter>();
|
List<Parameter> parameters = new List<Parameter>();
|
||||||
parameters.Add(GetParameter(key1, value1));
|
parameters.Add(GetParameter(key1, value1));
|
||||||
|
|
||||||
|
@ -54,6 +57,7 @@ namespace WZ
|
||||||
|
|
||||||
public void LogEvent(string eventName, Dictionary<string, object> dict)
|
public void LogEvent(string eventName, Dictionary<string, object> dict)
|
||||||
{
|
{
|
||||||
|
if (!FireBaseRemoteConfigManager.Instance.IsInitialized) return;
|
||||||
List<Parameter> parameters = new List<Parameter>();
|
List<Parameter> parameters = new List<Parameter>();
|
||||||
foreach (var item in dict)
|
foreach (var item in dict)
|
||||||
{
|
{
|
||||||
|
@ -72,6 +76,7 @@ namespace WZ
|
||||||
|
|
||||||
public void LogEvent(string eventName, Dictionary<string, string> dict)
|
public void LogEvent(string eventName, Dictionary<string, string> dict)
|
||||||
{
|
{
|
||||||
|
if (!FireBaseRemoteConfigManager.Instance.IsInitialized) return;
|
||||||
List<Parameter> parameters = new List<Parameter>();
|
List<Parameter> parameters = new List<Parameter>();
|
||||||
foreach (var item in dict)
|
foreach (var item in dict)
|
||||||
{
|
{
|
||||||
|
@ -162,6 +167,7 @@ namespace WZ
|
||||||
/// <param name="number">第几次展示该格式的广告</param>
|
/// <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)
|
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[] {
|
var impressionParameters = new[] {
|
||||||
new Firebase.Analytics.Parameter("ad_platform", ad_platform),
|
new Firebase.Analytics.Parameter("ad_platform", ad_platform),
|
||||||
new Firebase.Analytics.Parameter("ad_source", ad_source),
|
new Firebase.Analytics.Parameter("ad_source", ad_source),
|
||||||
|
|
|
@ -8,35 +8,37 @@ namespace WZ
|
||||||
{
|
{
|
||||||
public class FireBaseRemoteConfigManager : D_MonoSingleton<FireBaseRemoteConfigManager>
|
public class FireBaseRemoteConfigManager : D_MonoSingleton<FireBaseRemoteConfigManager>
|
||||||
{
|
{
|
||||||
|
public bool IsInitialized { get; private set; } = false;
|
||||||
public void FetchRemoteConfig()
|
public void FetchRemoteConfig()
|
||||||
{
|
{
|
||||||
// Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
|
// Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
|
||||||
// {
|
// {
|
||||||
// if (task.Result == Firebase.DependencyStatus.Available)
|
// if (task.Result == Firebase.DependencyStatus.Available)
|
||||||
// {
|
// {
|
||||||
Firebase.RemoteConfig.FirebaseRemoteConfig.DefaultInstance.FetchAsync(TimeSpan.Zero).ContinueWithOnMainThread(task =>
|
Firebase.RemoteConfig.FirebaseRemoteConfig.DefaultInstance.FetchAsync(TimeSpan.Zero).ContinueWithOnMainThread(task =>
|
||||||
{
|
{
|
||||||
FirebaseRemoteConfig.DefaultInstance.ActivateAsync().ContinueWithOnMainThread(task =>
|
FirebaseRemoteConfig.DefaultInstance.ActivateAsync().ContinueWithOnMainThread(task =>
|
||||||
{
|
{
|
||||||
AdjustTrackEvent.Instance.UpdateEventToken();
|
IsInitialized = true;
|
||||||
// 获取广告位信息
|
AdjustTrackEvent.Instance.UpdateEventToken();
|
||||||
AdConfigParser.Parse(GetRemoteConfigString("ad_config"));
|
// 获取广告位信息
|
||||||
// 刷新广告位信息
|
AdConfigParser.Parse(GetRemoteConfigString("ad_config"));
|
||||||
AdsSDKManager.Instance.RefreshAdsData();
|
// 刷新广告位信息
|
||||||
//AB测试分组参数
|
AdsSDKManager.Instance.RefreshAdsData();
|
||||||
GroupSet();
|
//AB测试分组参数
|
||||||
|
GroupSet();
|
||||||
|
|
||||||
// adjust卸载监控
|
// adjust卸载监控
|
||||||
|
|
||||||
/* 执行到这时,表示firebase接入正常,能获取到远端在线参数 */
|
/* 执行到这时,表示firebase接入正常,能获取到远端在线参数 */
|
||||||
|
|
||||||
// 设置 firebase 初始化成功 flag
|
// 设置 firebase 初始化成功 flag
|
||||||
|
|
||||||
// 初始化广告
|
// 初始化广告
|
||||||
|
|
||||||
// 检查Adjust归因
|
// 检查Adjust归因
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue