Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c0509da0fc | |||
| c9fe482c8c | |||
| 92d04aba61 |
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4fac2ab3b272f487c8ef6515ae7668e1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef8467ffb0e4447b79a8804884a7520a
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/ByteDance/Editor
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.applovin.mediation:bytedance-adapter:8.1.0.3.0">
|
||||
<repositories>
|
||||
<repository>https://artifact.bytedance.com/repository/pangle</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationByteDanceAdapter" version="8.1.0.6.0" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
@@ -1,10 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0828555cb1ce94702a4af6f3dce3d735
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/ByteDance/Editor/Dependencies.xml
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 324c3a2236ad740799b8b6dc27e85c82
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: db1de4066dc4e4290b3879b34fa87de2
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Mintegral/Editor
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.applovin.mediation:mintegral-adapter:17.1.61.0">
|
||||
<repositories>
|
||||
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
<androidPackage spec="androidx.recyclerview:recyclerview:1.2.1" />
|
||||
</androidPackages>
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationMintegralAdapter" version="8.1.4.0.0" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
@@ -1,10 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 221b2a20a58a04f2cb4afb0779587206
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Mintegral/Editor/Dependencies.xml
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6796c876aa794d13affab798ea46f1c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ecadc3649c184389b90252aa2a2b448
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Moloco/Editor
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.applovin.mediation:moloco-adapter:4.9.0.0" />
|
||||
</androidPackages>
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationMolocoAdapter" version="4.6.1.1" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
@@ -1,10 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f5b2cb1209274ba18b234b42d2efe96
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Moloco/Editor/Dependencies.xml
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4b1126795647541ba8c2eb166b7b70bc
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 277e2383262e844708fc74a6104f4985
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Yandex/Editor
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.applovin.mediation:yandex-adapter:8.1.0.0" />
|
||||
</androidPackages>
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationYandexAdapter" version="8.1.0.1" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
@@ -1,10 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a77aaf886990c4e6ba469a4f083b9284
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Yandex/Editor/Dependencies.xml
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -60,18 +60,13 @@ dependencies {
|
||||
implementation "com.google.android.libraries.identity.googleid:googleid:1.1.1"
|
||||
|
||||
// Android Resolver Dependencies Start
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.1' // Assets/MaxSdk/Mediation/Mintegral/Editor/Dependencies.xml:9
|
||||
implementation 'com.android.installreferrer:installreferrer:2.1' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:7
|
||||
implementation 'com.applovin.mediation:bytedance-adapter:8.1.0.3.0' // Assets/MaxSdk/Mediation/ByteDance/Editor/Dependencies.xml:8
|
||||
implementation 'com.applovin.mediation:facebook-adapter:[6.18.0.1]' // Assets/MaxSdk/Mediation/Facebook/Editor/Dependencies.xml:8
|
||||
implementation 'com.applovin.mediation:fyber-adapter:8.4.2.0' // Assets/MaxSdk/Mediation/Fyber/Editor/Dependencies.xml:4
|
||||
implementation 'com.applovin.mediation:google-adapter:[23.6.0.1]' // Assets/MaxSdk/Mediation/Google/Editor/Dependencies.xml:5
|
||||
implementation 'com.applovin.mediation:ironsource-adapter:8.6.1.0.0' // Assets/MaxSdk/Mediation/IronSource/Editor/Dependencies.xml:8
|
||||
implementation 'com.applovin.mediation:mintegral-adapter:17.1.61.0' // Assets/MaxSdk/Mediation/Mintegral/Editor/Dependencies.xml:8
|
||||
implementation 'com.applovin.mediation:moloco-adapter:4.9.0.0' // Assets/MaxSdk/Mediation/Moloco/Editor/Dependencies.xml:4
|
||||
implementation 'com.applovin.mediation:unityads-adapter:4.12.3.0' // Assets/MaxSdk/Mediation/UnityAds/Editor/Dependencies.xml:4
|
||||
implementation 'com.applovin.mediation:vungle-adapter:7.4.2.2' // Assets/MaxSdk/Mediation/Vungle/Editor/Dependencies.xml:4
|
||||
implementation 'com.applovin.mediation:yandex-adapter:8.1.0.0' // Assets/MaxSdk/Mediation/Yandex/Editor/Dependencies.xml:4
|
||||
implementation 'com.applovin:applovin-sdk:13.5.1' // Assets/MaxSdk/AppLovin/Editor/Dependencies.xml:4
|
||||
implementation 'com.appsflyer:af-android-sdk:6.17.3' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:5
|
||||
implementation 'com.appsflyer:purchase-connector:2.2.0' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:8
|
||||
|
||||
@@ -18,15 +18,9 @@ dependencyResolutionManagement {
|
||||
mavenCentral()
|
||||
// Android Resolver Repos Start
|
||||
def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
|
||||
maven {
|
||||
url "https://artifact.bytedance.com/repository/pangle" // Assets/MaxSdk/Mediation/ByteDance/Editor/Dependencies.xml:8
|
||||
}
|
||||
maven {
|
||||
url "https://android-sdk.is.com/" // Assets/MaxSdk/Mediation/IronSource/Editor/Dependencies.xml:8
|
||||
}
|
||||
maven {
|
||||
url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea" // Assets/MaxSdk/Mediation/Mintegral/Editor/Dependencies.xml:8
|
||||
}
|
||||
mavenLocal()
|
||||
// Android Resolver Repos End
|
||||
flatDir {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 813d4ac98b7f4092a3dddb472539f9d2
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9176f7473eb140f4af98b026642a0c8c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
public static class AdReadyStateLog
|
||||
{
|
||||
public static string FormatReadyCheck(string format, string adUnitId, bool isReady)
|
||||
{
|
||||
string status = isReady ? "OK" : "WARNING";
|
||||
return $"[{format}] Loaded callback ready check: adUnitId={adUnitId}, IsReady={isReady}, {status}";
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6db64ebff4c74a8e987935dcdf9fd211
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,423 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class AdTest : MonoBehaviour
|
||||
{
|
||||
[Header("Rewarded")]
|
||||
[SerializeField] private string androidRewardedAdUnitId = "c6c49a100de8496c";
|
||||
[SerializeField] private string iosRewardedAdUnitId = "ec3c8fd688cdb5e2";
|
||||
|
||||
[Header("Interstitial")]
|
||||
[SerializeField] private string androidInterstitialAdUnitId = "0dcd37fa0885aa1f";
|
||||
[SerializeField] private string iosInterstitialAdUnitId = "interstitial_test_ios";
|
||||
|
||||
[Header("UI")]
|
||||
[SerializeField] private Button initMaxButton;
|
||||
[SerializeField] private Button loadRewardedButton;
|
||||
[SerializeField] private Button showRewardedButton;
|
||||
[SerializeField] private Button forceShowRewardedButton;
|
||||
[SerializeField] private Button checkRewardedReadyButton;
|
||||
[SerializeField] private Button loadInterstitialButton;
|
||||
[SerializeField] private Button showInterstitialButton;
|
||||
[SerializeField] private Button forceShowInterstitialButton;
|
||||
[SerializeField] private Button checkInterstitialReadyButton;
|
||||
[SerializeField] private Button mediationDebuggerButton;
|
||||
[SerializeField] private Button clearLogButton;
|
||||
[SerializeField] private Text logText;
|
||||
|
||||
private const int MaxLogLines = 80;
|
||||
private readonly List<string> logLines = new List<string>();
|
||||
private bool callbacksRegistered;
|
||||
private bool sdkInitializeRequested;
|
||||
private int rewardedLoadFailCount;
|
||||
private int interstitialLoadFailCount;
|
||||
|
||||
private string RewardedAdUnitId
|
||||
{
|
||||
get
|
||||
{
|
||||
#if UNITY_IOS
|
||||
return iosRewardedAdUnitId;
|
||||
#else
|
||||
return androidRewardedAdUnitId;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
private string InterstitialAdUnitId
|
||||
{
|
||||
get
|
||||
{
|
||||
#if UNITY_IOS
|
||||
return iosInterstitialAdUnitId;
|
||||
#else
|
||||
return androidInterstitialAdUnitId;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
public void Configure(
|
||||
Button initMax,
|
||||
Button loadRewarded,
|
||||
Button showRewarded,
|
||||
Button forceShowRewarded,
|
||||
Button checkRewardedReady,
|
||||
Button loadInterstitial,
|
||||
Button showInterstitial,
|
||||
Button forceShowInterstitial,
|
||||
Button checkInterstitialReady,
|
||||
Button mediationDebugger,
|
||||
Button clearLog,
|
||||
Text output)
|
||||
{
|
||||
initMaxButton = initMax;
|
||||
loadRewardedButton = loadRewarded;
|
||||
showRewardedButton = showRewarded;
|
||||
forceShowRewardedButton = forceShowRewarded;
|
||||
checkRewardedReadyButton = checkRewardedReady;
|
||||
loadInterstitialButton = loadInterstitial;
|
||||
showInterstitialButton = showInterstitial;
|
||||
forceShowInterstitialButton = forceShowInterstitial;
|
||||
checkInterstitialReadyButton = checkInterstitialReady;
|
||||
mediationDebuggerButton = mediationDebugger;
|
||||
clearLogButton = clearLog;
|
||||
logText = output;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Bind(initMaxButton, InitMax);
|
||||
Bind(loadRewardedButton, LoadRewarded);
|
||||
Bind(showRewardedButton, ShowRewarded);
|
||||
Bind(forceShowRewardedButton, ForceShowRewarded);
|
||||
Bind(checkRewardedReadyButton, CheckRewardedReady);
|
||||
Bind(loadInterstitialButton, LoadInterstitial);
|
||||
Bind(showInterstitialButton, ShowInterstitial);
|
||||
Bind(forceShowInterstitialButton, ForceShowInterstitial);
|
||||
Bind(checkInterstitialReadyButton, CheckInterstitialReady);
|
||||
Bind(mediationDebuggerButton, ShowMediationDebugger);
|
||||
Bind(clearLogButton, ClearLog);
|
||||
AppendLog("AdTest ready.");
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (!callbacksRegistered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MaxSdkCallbacks.OnSdkInitializedEvent -= OnSdkInitialized;
|
||||
|
||||
MaxSdkCallbacks.Rewarded.OnAdLoadedEvent -= OnRewardedAdLoaded;
|
||||
MaxSdkCallbacks.Rewarded.OnAdLoadFailedEvent -= OnRewardedAdLoadFailed;
|
||||
MaxSdkCallbacks.Rewarded.OnAdDisplayedEvent -= OnRewardedAdDisplayed;
|
||||
MaxSdkCallbacks.Rewarded.OnAdDisplayFailedEvent -= OnRewardedAdDisplayFailed;
|
||||
MaxSdkCallbacks.Rewarded.OnAdHiddenEvent -= OnRewardedAdHidden;
|
||||
MaxSdkCallbacks.Rewarded.OnAdReceivedRewardEvent -= OnRewardedAdReceivedReward;
|
||||
MaxSdkCallbacks.Rewarded.OnAdRevenuePaidEvent -= OnRewardedAdRevenuePaid;
|
||||
|
||||
MaxSdkCallbacks.Interstitial.OnAdLoadedEvent -= OnInterstitialAdLoaded;
|
||||
MaxSdkCallbacks.Interstitial.OnAdLoadFailedEvent -= OnInterstitialAdLoadFailed;
|
||||
MaxSdkCallbacks.Interstitial.OnAdDisplayedEvent -= OnInterstitialAdDisplayed;
|
||||
MaxSdkCallbacks.Interstitial.OnAdDisplayFailedEvent -= OnInterstitialAdDisplayFailed;
|
||||
MaxSdkCallbacks.Interstitial.OnAdHiddenEvent -= OnInterstitialAdHidden;
|
||||
MaxSdkCallbacks.Interstitial.OnAdRevenuePaidEvent -= OnInterstitialAdRevenuePaid;
|
||||
}
|
||||
|
||||
private void Bind(Button button, Action action)
|
||||
{
|
||||
if (button == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
button.onClick.AddListener(() => action());
|
||||
}
|
||||
|
||||
public void InitMax()
|
||||
{
|
||||
RegisterCallbacks();
|
||||
|
||||
if (sdkInitializeRequested)
|
||||
{
|
||||
AppendLog("MAX initialization already requested.");
|
||||
return;
|
||||
}
|
||||
|
||||
sdkInitializeRequested = true;
|
||||
MaxSdk.SetHasUserConsent(true);
|
||||
MaxSdk.SetDoNotSell(false);
|
||||
#if UNITY_IOS
|
||||
MaxSdk.SetExtraParameter("disable_b2b_ad_unit_ids", "ec3c8fd688cdb5e2,00442f7962682a80");
|
||||
#else
|
||||
MaxSdk.SetExtraParameter("disable_b2b_ad_unit_ids", "c6c49a100de8496c,0dcd37fa0885aa1f");
|
||||
#endif
|
||||
MaxSdk.InitializeSdk();
|
||||
AppendLog("MAX initialization requested.");
|
||||
}
|
||||
|
||||
public void LoadRewarded()
|
||||
{
|
||||
EnsureInitialized();
|
||||
AppendLog($"Load rewarded: {RewardedAdUnitId}");
|
||||
MaxSdk.LoadRewardedAd(RewardedAdUnitId);
|
||||
}
|
||||
|
||||
public void ShowRewarded()
|
||||
{
|
||||
EnsureInitialized();
|
||||
bool isReady = MaxSdk.IsRewardedAdReady(RewardedAdUnitId);
|
||||
AppendLog($"Show rewarded requested. IsReady={isReady}");
|
||||
|
||||
if (isReady)
|
||||
{
|
||||
MaxSdk.ShowRewardedAd(RewardedAdUnitId);
|
||||
return;
|
||||
}
|
||||
|
||||
LoadRewarded();
|
||||
}
|
||||
|
||||
public void ForceShowRewarded()
|
||||
{
|
||||
EnsureInitialized();
|
||||
AppendLog($"Force show rewarded without ready check: {RewardedAdUnitId}");
|
||||
MaxSdk.ShowRewardedAd(RewardedAdUnitId);
|
||||
}
|
||||
|
||||
public void CheckRewardedReady()
|
||||
{
|
||||
EnsureInitialized();
|
||||
bool isReady = MaxSdk.IsRewardedAdReady(RewardedAdUnitId);
|
||||
AppendReadyCheck("Rewarded", RewardedAdUnitId, isReady);
|
||||
}
|
||||
|
||||
public void LoadInterstitial()
|
||||
{
|
||||
EnsureInitialized();
|
||||
if (string.IsNullOrEmpty(InterstitialAdUnitId))
|
||||
{
|
||||
AppendWarning("Interstitial ad unit ID is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
AppendLog($"Load interstitial: {InterstitialAdUnitId}");
|
||||
MaxSdk.LoadInterstitial(InterstitialAdUnitId);
|
||||
}
|
||||
|
||||
public void ShowInterstitial()
|
||||
{
|
||||
EnsureInitialized();
|
||||
if (string.IsNullOrEmpty(InterstitialAdUnitId))
|
||||
{
|
||||
AppendWarning("Interstitial ad unit ID is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
bool isReady = MaxSdk.IsInterstitialReady(InterstitialAdUnitId);
|
||||
AppendLog($"Show interstitial requested. IsReady={isReady}");
|
||||
|
||||
if (isReady)
|
||||
{
|
||||
MaxSdk.ShowInterstitial(InterstitialAdUnitId);
|
||||
return;
|
||||
}
|
||||
|
||||
LoadInterstitial();
|
||||
}
|
||||
|
||||
public void ForceShowInterstitial()
|
||||
{
|
||||
EnsureInitialized();
|
||||
if (string.IsNullOrEmpty(InterstitialAdUnitId))
|
||||
{
|
||||
AppendWarning("Interstitial ad unit ID is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
AppendLog($"Force show interstitial without ready check: {InterstitialAdUnitId}");
|
||||
MaxSdk.ShowInterstitial(InterstitialAdUnitId);
|
||||
}
|
||||
|
||||
public void CheckInterstitialReady()
|
||||
{
|
||||
EnsureInitialized();
|
||||
if (string.IsNullOrEmpty(InterstitialAdUnitId))
|
||||
{
|
||||
AppendWarning("Interstitial ad unit ID is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
bool isReady = MaxSdk.IsInterstitialReady(InterstitialAdUnitId);
|
||||
AppendReadyCheck("Interstitial", InterstitialAdUnitId, isReady);
|
||||
}
|
||||
|
||||
public void ClearLog()
|
||||
{
|
||||
logLines.Clear();
|
||||
if (logText != null)
|
||||
{
|
||||
logText.text = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowMediationDebugger()
|
||||
{
|
||||
AppendLog("Show mediation debugger requested.");
|
||||
MaxSdk.ShowMediationDebugger();
|
||||
}
|
||||
|
||||
private void EnsureInitialized()
|
||||
{
|
||||
if (!sdkInitializeRequested)
|
||||
{
|
||||
InitMax();
|
||||
}
|
||||
}
|
||||
|
||||
private void RegisterCallbacks()
|
||||
{
|
||||
if (callbacksRegistered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
callbacksRegistered = true;
|
||||
MaxSdkCallbacks.OnSdkInitializedEvent += OnSdkInitialized;
|
||||
|
||||
MaxSdkCallbacks.Rewarded.OnAdLoadedEvent += OnRewardedAdLoaded;
|
||||
MaxSdkCallbacks.Rewarded.OnAdLoadFailedEvent += OnRewardedAdLoadFailed;
|
||||
MaxSdkCallbacks.Rewarded.OnAdDisplayedEvent += OnRewardedAdDisplayed;
|
||||
MaxSdkCallbacks.Rewarded.OnAdDisplayFailedEvent += OnRewardedAdDisplayFailed;
|
||||
MaxSdkCallbacks.Rewarded.OnAdHiddenEvent += OnRewardedAdHidden;
|
||||
MaxSdkCallbacks.Rewarded.OnAdReceivedRewardEvent += OnRewardedAdReceivedReward;
|
||||
MaxSdkCallbacks.Rewarded.OnAdRevenuePaidEvent += OnRewardedAdRevenuePaid;
|
||||
|
||||
MaxSdkCallbacks.Interstitial.OnAdLoadedEvent += OnInterstitialAdLoaded;
|
||||
MaxSdkCallbacks.Interstitial.OnAdLoadFailedEvent += OnInterstitialAdLoadFailed;
|
||||
MaxSdkCallbacks.Interstitial.OnAdDisplayedEvent += OnInterstitialAdDisplayed;
|
||||
MaxSdkCallbacks.Interstitial.OnAdDisplayFailedEvent += OnInterstitialAdDisplayFailed;
|
||||
MaxSdkCallbacks.Interstitial.OnAdHiddenEvent += OnInterstitialAdHidden;
|
||||
MaxSdkCallbacks.Interstitial.OnAdRevenuePaidEvent += OnInterstitialAdRevenuePaid;
|
||||
}
|
||||
|
||||
private void OnSdkInitialized(MaxSdkBase.SdkConfiguration configuration)
|
||||
{
|
||||
AppendLog($"MAX initialized. Success={configuration.IsSuccessfullyInitialized}");
|
||||
}
|
||||
|
||||
private void OnRewardedAdLoaded(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
rewardedLoadFailCount = 0;
|
||||
AppendLog($"Rewarded loaded callback: {adUnitId}");
|
||||
bool isReady = MaxSdk.IsRewardedAdReady(adUnitId);
|
||||
AppendReadyCheck("Rewarded", adUnitId, isReady);
|
||||
}
|
||||
|
||||
private void OnRewardedAdLoadFailed(string adUnitId, MaxSdkBase.ErrorInfo errorInfo)
|
||||
{
|
||||
rewardedLoadFailCount++;
|
||||
AppendWarning($"Rewarded load failed: {adUnitId}, attempt={rewardedLoadFailCount}, message={errorInfo.Message}");
|
||||
}
|
||||
|
||||
private void OnRewardedAdDisplayed(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
AppendLog($"Rewarded displayed: {adUnitId}");
|
||||
}
|
||||
|
||||
private void OnRewardedAdDisplayFailed(string adUnitId, MaxSdkBase.ErrorInfo errorInfo, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
AppendWarning($"Rewarded display failed: {adUnitId}, message={errorInfo.Message}");
|
||||
LoadRewarded();
|
||||
}
|
||||
|
||||
private void OnRewardedAdHidden(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
AppendLog($"Rewarded hidden: {adUnitId}");
|
||||
LoadRewarded();
|
||||
}
|
||||
|
||||
private void OnRewardedAdReceivedReward(string adUnitId, MaxSdkBase.Reward reward, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
AppendLog($"Rewarded received reward: {adUnitId}, label={reward.Label}, amount={reward.Amount}");
|
||||
}
|
||||
|
||||
private void OnRewardedAdRevenuePaid(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
AppendLog($"Rewarded revenue paid: {adUnitId}, revenue={adInfo.Revenue}");
|
||||
}
|
||||
|
||||
private void OnInterstitialAdLoaded(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
interstitialLoadFailCount = 0;
|
||||
AppendLog($"Interstitial loaded callback: {adUnitId}");
|
||||
bool isReady = MaxSdk.IsInterstitialReady(adUnitId);
|
||||
AppendReadyCheck("Interstitial", adUnitId, isReady);
|
||||
}
|
||||
|
||||
private void OnInterstitialAdLoadFailed(string adUnitId, MaxSdkBase.ErrorInfo errorInfo)
|
||||
{
|
||||
interstitialLoadFailCount++;
|
||||
AppendWarning($"Interstitial load failed: {adUnitId}, attempt={interstitialLoadFailCount}, message={errorInfo.Message}");
|
||||
}
|
||||
|
||||
private void OnInterstitialAdDisplayed(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
AppendLog($"Interstitial displayed: {adUnitId}");
|
||||
}
|
||||
|
||||
private void OnInterstitialAdDisplayFailed(string adUnitId, MaxSdkBase.ErrorInfo errorInfo, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
AppendWarning($"Interstitial display failed: {adUnitId}, message={errorInfo.Message}");
|
||||
LoadInterstitial();
|
||||
}
|
||||
|
||||
private void OnInterstitialAdHidden(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
AppendLog($"Interstitial hidden: {adUnitId}");
|
||||
LoadInterstitial();
|
||||
}
|
||||
|
||||
private void OnInterstitialAdRevenuePaid(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
AppendLog($"Interstitial revenue paid: {adUnitId}, revenue={adInfo.Revenue}");
|
||||
}
|
||||
|
||||
private void AppendReadyCheck(string format, string adUnitId, bool isReady)
|
||||
{
|
||||
string line = AdReadyStateLog.FormatReadyCheck(format, adUnitId, isReady);
|
||||
if (isReady)
|
||||
{
|
||||
AppendLog(line);
|
||||
}
|
||||
else
|
||||
{
|
||||
AppendWarning(line);
|
||||
}
|
||||
}
|
||||
|
||||
private void AppendWarning(string message)
|
||||
{
|
||||
AppendLog(message, true);
|
||||
}
|
||||
|
||||
private void AppendLog(string message, bool warning = false)
|
||||
{
|
||||
string line = $"[{DateTime.Now:HH:mm:ss}] {message}";
|
||||
logLines.Add(line);
|
||||
while (logLines.Count > MaxLogLines)
|
||||
{
|
||||
logLines.RemoveAt(0);
|
||||
}
|
||||
|
||||
if (logText != null)
|
||||
{
|
||||
logText.text = string.Join("\n", logLines);
|
||||
}
|
||||
|
||||
// This scene is for device-side manual QA, so the UI log is the source of truth.
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 70a4079f02f94f47a9a065de6d76f8f2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,98 +0,0 @@
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class AdTestSceneBootstrap : MonoBehaviour
|
||||
{
|
||||
private void Awake()
|
||||
{
|
||||
EnsureEventSystem();
|
||||
|
||||
AdTest adTest = GetComponent<AdTest>();
|
||||
if (adTest == null)
|
||||
{
|
||||
adTest = gameObject.AddComponent<AdTest>();
|
||||
}
|
||||
|
||||
adTest.Configure(
|
||||
FindButton("InitMax", "Init"),
|
||||
FindButton("LoadRewardedAd", "LoadRewarded", "Load Rewarded", "RewardedLoad"),
|
||||
FindButton("RewardedAd", "Max", "ShowRewarded", "Show Rewarded", "RewardedShow"),
|
||||
FindButton("ForceRewardedAd", "ForceRewarded", "Force Rewarded"),
|
||||
FindButton("CheckRewardedReady", "CheckRewarded", "Check Rewarded", "RewardedReady"),
|
||||
FindButton("LoadInterstitialAd", "LoadInterstitial", "Load Interstitial", "InterstitialLoad", "PayList"),
|
||||
FindButton("ShowInterstitialAd", "ShowInterstitial", "Show Interstitial", "InterstitialShow", "Pay"),
|
||||
FindButton("ForceInterstitialAd", "ForceInterstitial", "Force Interstitial"),
|
||||
FindButton("CheckInterstitialReady", "CheckInterstitial", "Check Interstitial", "InterstitialReady"),
|
||||
FindButton("MediationDebugger", "ATT", "Debugger", "Mediation Debugger"),
|
||||
FindButton("ClearLog", "Clear Log"),
|
||||
FindText("Message", "Log", "LogText"));
|
||||
|
||||
RenameButton("InitMax", "Init MAX");
|
||||
RenameButton("LoadRewardedAd", "Load Reward");
|
||||
RenameButton("CheckRewardedReady", "Check Reward");
|
||||
RenameButton("RewardedAd", "Rewarded");
|
||||
RenameButton("ForceRewardedAd", "Force Reward");
|
||||
RenameButton("LoadInterstitialAd", "Load Inter");
|
||||
RenameButton("CheckInterstitialReady", "Check Inter");
|
||||
RenameButton("ShowInterstitialAd", "Show Inter");
|
||||
RenameButton("ForceInterstitialAd", "Force Inter");
|
||||
RenameButton("MediationDebugger", "Debugger");
|
||||
RenameButton("ClearLog", "Clear Log");
|
||||
}
|
||||
|
||||
private void EnsureEventSystem()
|
||||
{
|
||||
if (FindObjectOfType<EventSystem>() != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GameObject eventSystem = new GameObject("EventSystem");
|
||||
eventSystem.AddComponent<EventSystem>();
|
||||
eventSystem.AddComponent<StandaloneInputModule>();
|
||||
}
|
||||
|
||||
private Button FindButton(params string[] names)
|
||||
{
|
||||
foreach (string name in names)
|
||||
{
|
||||
GameObject target = GameObject.Find(name);
|
||||
if (target != null && target.TryGetComponent(out Button button))
|
||||
{
|
||||
return button;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private Text FindText(params string[] names)
|
||||
{
|
||||
foreach (string name in names)
|
||||
{
|
||||
GameObject target = GameObject.Find(name);
|
||||
if (target != null && target.TryGetComponent(out Text text))
|
||||
{
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void RenameButton(string buttonName, string label)
|
||||
{
|
||||
GameObject target = GameObject.Find(buttonName);
|
||||
if (target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Text text = target.GetComponentInChildren<Text>();
|
||||
if (text != null)
|
||||
{
|
||||
text.text = label;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f4c0e3f6b3d4d6b9b8a923dc1274d31
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -133,16 +133,11 @@ public class SDKTest : MonoBehaviour
|
||||
MaxSdkCallbacks.OnSdkInitializedEvent += (MaxSdkBase.SdkConfiguration sdkConfiguration) =>
|
||||
{
|
||||
Debug.Log($"[MaxSdk::OnSdkInitializedEvent] Init:{sdkConfiguration.IsSuccessfullyInitialized}");
|
||||
};
|
||||
MaxSdk.SetHasUserConsent(true);
|
||||
MaxSdk.SetDoNotSell(false);
|
||||
#if UNITY_IOS
|
||||
MaxSdk.SetExtraParameter("disable_b2b_ad_unit_ids", "ec3c8fd688cdb5e2,00442f7962682a80");
|
||||
#else
|
||||
MaxSdk.SetExtraParameter("disable_b2b_ad_unit_ids", "c6c49a100de8496c,0dcd37fa0885aa1f");
|
||||
#endif
|
||||
MaxSdk.InitializeSdk();
|
||||
}
|
||||
};
|
||||
MaxSdk.SetHasUserConsent(true);
|
||||
MaxSdk.SetDoNotSell(false);
|
||||
MaxSdk.InitializeSdk();
|
||||
}
|
||||
|
||||
private async void OnLogin(EAccoutType accoutType)
|
||||
{
|
||||
|
||||
@@ -44,8 +44,6 @@ import org.json.JSONObject;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import kotlinx.serialization.json.Json;
|
||||
|
||||
public class SDKManager {
|
||||
|
||||
private final static Handler handler = new Handler(Looper.getMainLooper());
|
||||
@@ -124,6 +122,7 @@ public class SDKManager {
|
||||
|
||||
public static void UnityResetServerUrl(String url) {
|
||||
SDKLog.i("UnityResetServerUrl : " + url);
|
||||
SetDNSIPsEnable(false);
|
||||
SDKAPI.getIns().updateServer(url);
|
||||
}
|
||||
|
||||
@@ -561,6 +560,18 @@ public class SDKManager {
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetDNSIPsEnable(boolean enable) {
|
||||
SDKAPI.enableDoh(enable);
|
||||
if(enable) {
|
||||
SDKAPI.setHttpDnsIps(new String[]{
|
||||
"34.111.1.231",
|
||||
"2600:1901:0:c31b::"
|
||||
});
|
||||
}
|
||||
else{
|
||||
SDKAPI.setHttpDnsIps(new String[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ public class TYApp extends Application {
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
SDKAPI.getIns().onApplicationCreate(this);
|
||||
SDKManager.SetDNSIPsEnable(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -19,4 +20,5 @@ public class TYApp extends Application {
|
||||
super.attachBaseContext(base);
|
||||
SDKAPI.getIns().onAttachBaseContext(base, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -364,6 +364,13 @@ namespace tysdk
|
||||
UnityBridgeFunc.CleanLinkTmpSnsInfo();
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public async Task<ChangeLinkResult> ChangeLinkAccount(EAccoutType accoutType, int oldUserId, int newUserId)
|
||||
{
|
||||
await Task.Delay(300);
|
||||
return new ChangeLinkResult(){code = 1};
|
||||
}
|
||||
#elif UNITY_IOS || UNITY_ANDROID
|
||||
public async Task<ChangeLinkResult> ChangeLinkAccount(EAccoutType accoutType, int oldUserId, int newUserId)
|
||||
{
|
||||
var task = TYSDKCallbackManager.Instance.RegisterCallback<ChangeLinkResult>(TimeSpan.FromSeconds(30));
|
||||
@@ -388,6 +395,7 @@ namespace tysdk
|
||||
CleanLinkTempSnSInfo();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
public void ChangeLinkAccountResult(string message)
|
||||
{
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
<dependencies>
|
||||
<packages>
|
||||
<package>androidx.recyclerview:recyclerview:1.2.1</package>
|
||||
<package>com.android.installreferrer:installreferrer:2.1</package>
|
||||
<package>com.applovin.mediation:bytedance-adapter:8.1.0.3.0</package>
|
||||
<package>com.applovin.mediation:facebook-adapter:[6.18.0.1]</package>
|
||||
<package>com.applovin.mediation:fyber-adapter:8.4.2.0</package>
|
||||
<package>com.applovin.mediation:google-adapter:[23.6.0.1]</package>
|
||||
<package>com.applovin.mediation:ironsource-adapter:8.6.1.0.0</package>
|
||||
<package>com.applovin.mediation:mintegral-adapter:17.1.61.0</package>
|
||||
<package>com.applovin.mediation:moloco-adapter:4.9.0.0</package>
|
||||
<package>com.applovin.mediation:unityads-adapter:4.12.3.0</package>
|
||||
<package>com.applovin.mediation:vungle-adapter:7.4.2.2</package>
|
||||
<package>com.applovin.mediation:yandex-adapter:8.1.0.0</package>
|
||||
<package>com.applovin:applovin-sdk:13.5.1</package>
|
||||
<package>com.appsflyer:af-android-sdk:6.17.3</package>
|
||||
<package>com.appsflyer:purchase-connector:2.2.0</package>
|
||||
|
||||
@@ -4,5 +4,11 @@
|
||||
EditorBuildSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Scenes: []
|
||||
m_Scenes:
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/SampleScene.unity
|
||||
guid: 99c9720ab356a0642a771bea13969a05
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/UnbindTest.unity
|
||||
guid: e55d807d563854943a26ad6dadec548d
|
||||
m_configObjects: {}
|
||||
|
||||
Reference in New Issue
Block a user