I’m testing live (production) ads in my app before uploading to the app store but I’m getting an Error Code 1 error when attempting to load either banner or interstitial ads. I have double-checked the ad unit ids and the app id, but everything seems to be correct. Everything worked fine with the test mode as true.
The App ID is set in Build.Settings as per the new guidelines. I get this from the console:
- [I-ACS025031] AdMob App ID changed. Original, new: (nil), ca-app-pub-###~###
- [I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
- [I-ACS023007] Analytics v.60802000 started
- [I-ACS023008] To enable debug logging set the following application argument: -APMAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
- [I-ACS023012] Analytics collection enabled
To get test ads on this device, set: GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ @“e13a6f52e5c54fba50cbcf7308ce171b” ];
It would seem everything there is working fine although I’m not sure why it would send the message about test ads.
I also dump the error details from the load failing:
AdMob error: loadFailed : {“errorCode”:1,“adUnitId”:“ca-app-pub-###/###”,“errorMsg”:“Request Error: No ad to show.”}
I’ve double-checked the ad id. The only odd part is that “/” is showing as “/” in the error message, but I assume that’s just how event.data will display when being dumped to a log rather than the screen.
As far as I know, if Google wasn’t sending ads because the app id was too new or some similar reason, it would send a different error code (I think error code 3) and that error code 1 comes down to incorrect configuration.
I’ve tried everything I know at this point. Here’s the code to initialize and load the interstitial ad:
local bannerUnitID = “ca-app-pub-###/###”
local interstitialUnitID = “ca-app-pub-###/###”
function admobInit()
admob.init( adListener, {testMode=false } )
end
timer.performWithDelay(250,admobInit);
function showBigAd ()
local flag=true;
if ( admob.isLoaded( “interstitial” ) == true ) then
admob.show( “interstitial” );
else
flag=false;
end
return flag;
end
function loadInterstitial()
admob.load( “interstitial”, { adUnitId=interstitialUnitID, childSafe=true } )
end
local function adListener( event )
if (event.isError) then
print ("AdMob error: "..event.response.." : "..event.data);
end
if ( event.phase == "init" ) then
timer.performWithDelay(200,loadBanner);
timer.performWithDelay(200,loadInterstitial);
elseif ( event.phase == "closed" ) then
timer.performWithDelay(200,loadBanner);
timer.performWithDelay(200,loadInterstitial);
elseif ( event.phase == "clicked" ) then
timer.performWithDelay(200,loadBanner);
timer.performWithDelay(200,loadInterstitial);
elseif ( event.phase == "failed" ) then
if (event.type=='banner') then
timer.performWithDelay(5000,loadBanner);
elseif ( event.type == "interstitial" ) then
timer.performWithDelay(3000,loadInterstitial);
end
end
end
And here’s the relevant part of build.settings:
GADApplicationIdentifier = "ca-app-pub-###~###" ,
SKAdNetworkItems = {
{
SKAdNetworkIdentifier = "cstr6suwn9.skadnetwork",
},
},
NSUserTrackingUsageDescription = "This would allow Rogue Party to advertise better.",
NSAppTransportSecurity = { NSAllowsArbitraryLoads = true,NSAllowsArbitraryLoadsForMedia=true,NSAllowsArbitraryLoadsInWebContent=true } ,
},
I’m loading plugin.att even though I’m not using it for anything yet, thus the lines in build.settings.
Adding to the mystery: Ad mob reports ad requests. The total number of ad requests is different from the requests filtering by just the interstitial which is different than the requests for just the banner, so it does seem to be getting the right App ID and the right Ad Unit IDs because it can differentiate them.
My thought is it is probably just not serving because the app isn’t live yet, but again, everything I’ve read suggests that would be Error Code 3 and not Error Code 1.