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
'Unity > Unity 이슈' 카테고리의 다른 글
Slider 이미지 가로가 제대로 늘어나지 않을 때 (0) | 2023.08.13 |
---|---|
Unity 프로젝트 전체에서 Asset Reference 찾기 (0) | 2023.01.11 |
Admob 광고단위(AdUnitId) (0) | 2022.12.23 |
Unity 구글 로그인 실패 Case #4 (0) | 2022.12.23 |
Unity 구글 로그인 실패 Case #3 (0) | 2022.12.23 |