Unity/Unity 이슈

Admob 리워드 광고 로드 실패

lipnus 2022. 12. 26. 13:46
반응형

Problem

리워드 광고 요청이 안됨

 

 

로그 추출 코드

public void Start()
{
    RequestRewardAd();
}

private void RequestRewardAd()
{
    Debug.Log("RequestRewardAd");
    rewardedAd = new RewardedAd(adUnitId);

    // Called when an ad request has successfully loaded.
    rewardedAd.OnAdLoaded += HandleRewardedAdLoaded;
    rewardedAd.OnAdFailedToLoad += HandleRewardedAdFailedToLoad;
    rewardedAd.OnAdOpening += HandleRewardedAdOpening;
    rewardedAd.OnAdFailedToShow += HandleRewardedAdFailedToShow;
    rewardedAd.OnUserEarnedReward += HandleUserEarnedReward;
    rewardedAd.OnAdClosed += HandleRewardedAdClosed;

    var request = new AdRequest.Builder().Build();
    rewardedAd.LoadAd(request);
}

private void HandleRewardedAdFailedToLoad(object sender, AdFailedToLoadEventArgs e)
    {
        print($"### HandleRewardedAdFailedToLoad event received: {e}");
        var loadAdError = e.LoadAdError;

        // Gets the domain from which the error came.
        var domain = loadAdError.GetDomain();

        // Gets the error code. See
        // https://developers.google.com/android/reference/com/google/android/gms/ads/AdRequest
        // and https://developers.google.com/admob/ios/api/reference/Enums/GADErrorCode
        // for a list of possible codes.
        var code = loadAdError.GetCode();

        // Gets an error message.
        // For example "Account not approved yet". See
        // https://support.google.com/admob/answer/9905175 for explanations of
        // common errors.
        var message = loadAdError.GetMessage();

        // Gets the cause of the error, if available.
        var underlyingError = loadAdError.GetCause();

        // All of this information is available via the error's toString() method.
        Debug.Log("Load error string: " + loadAdError.ToString());

        // Get response information, which may include results of mediation requests.
        var responseInfo = loadAdError.GetResponseInfo();
        Debug.Log("Response info: " + responseInfo.ToString());
    }

 

Log

### HandleRewardedAdFailedToLoad event received: GoogleMobileAds.Api.AdFailedToLoadEventArgs 
System.Reflection.RuntimeMethodInfo:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) 
UnityEngine.AndroidJavaProxy:Invoke(String, Object[]) 
UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr) 


   : ### HandleRewardedAdFailedToLoad event received: GoogleMobileAds.Api.AdFailedToLoadEventArgs 
   : AdManager:HandleRewardedAdFailedToLoad(Object, AdFailedToLoadEventArgs) 
   : System.Reflection.RuntimeMethodInfo:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) 
   : UnityEngine.AndroidJavaProxy:Invoke(String, Object[]) 
   : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr) 
   :  
   : Load error string: { 
   :   "Code": 3, 
   :   "Message": "No ad config.", 
   :   "Domain": "com.google.android.gms.ads", 
   :   "Cause": "null", 
   :   "Response Info": { 
   :     "Response ID": "null", 
   :     "Mediation Adapter Class Name": "", 
   :     "Adapter Responses": [] 
   :   } 
   : } 
   : AdManager:HandleRewardedAdFailedToLoad(Object, AdFailedToLoadEventArgs) 
   : System.Reflection.RuntimeMethodInfo:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) 
   : UnityEngine.AndroidJavaProxy:Invoke(String, Object[]) 
   : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr) 
   :  
   : Response info: { 
   :   "Response ID": "null", 
   :   "Mediation Adapter Class Name": "", 
   :   "Adapter Responses": [] 
   : } 
   : System.Reflection.RuntimeMethodInfo:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) 
   : UnityEngine.AndroidJavaProxy:Invoke(String, Object[]) 
   : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr) 

 

 

Solution

앱을 게제한지 얼마 안되서 광고가 집행되지 않아서 그렇다고 함.

일단 기다려 본다..

https://developers.google.com/android/reference/com/google/android/gms/ads/AdRequest

 

AdRequest  |  Google Play services  |  Google Developers

com.google.android.gms.dtdi

developers.google.com

 

 

반응형