CoronaAds works on my android, but not Iphone

So I got my game working for both Android, and Iphone, but the only difference is that ads will show up on my android phone, but NOT the iPhone.  I added in extra if-statements to see where it’s going wrong. 

 

local function adListener(event) if (event.phase == "init") then showAd() elseif ( event.phase == "request" ) then local adText = display.newText("An Add Was Requested", 30, 30, "Impact", 40) elseif ( event.phase == "found" ) then local adText1 = display.newText("An ad was found", 30, 40, "Impact", 40) elseif ( event.phase == "shown" ) then local adText2 = display.newText("The ad has shown", 30, 50, "Impact", 40) elseif ( event.phase == "closed" or event.phase == "failed" ) then local adText3 = display.newText("An ad was closed/hidden, or an ad could not be found", 30, 60, "Impact", 40) end end

For the iPhone, it’s hitting the failed phase every time. 

Here’s some code to see it initialized and blah blah. 

build.settings:
 

-- -- For more information on build.settings see the Corona SDK Build Guide at: -- https://docs.coronalabs.com/guide/distribution/buildSettings -- settings = { orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "landscapeRight", supported = { "landscapeRight", }, }, excludeFiles = { -- Include only the necessary icon files on each platform android = { "Icon-\*dpi.png", }, iphone = { "Icon.png", "Icon-Small-\*.png", "Icon\*@2x.png", }, }, -- -- iOS Section -- iphone = { plist = { NSAppTransportSecurity = { NSAllowsArbitraryLoads=true }, NSLocationAlwaysUsageDescription = { "" }, NSLocationWhenInUseUsageDescription = { "" }, UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend --ads for iphone CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-167.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", }, }, }, -- -- Android Section -- android = { usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE" }, }, -- -- For Ads -- plugins = { ["plugin.coronaAds"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, ["shared.android.support.v4"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, ["plugin.gameanalytics\_v2"] = { publisherId = "com.gameanalytics", supportedPlatforms = { iphone=true, android=true } }, -- ["plugin.googleAnalytics"] = -- { -- publisherId = "com.coronalabs", -- supportedPlatforms = { iphone=true, android=false } -- }, }, }

now in my restart.lua, where the ads are supposed to show:

 

local coronaAds = require( "plugin.coronaAds" ) local scene = composer.newScene() \_W = display.contentWidth; \_H = display.contentHeight local bannerPlacement = "top-banner-320x50" local interstitialPlacement = "interstitial-1" local randomAd = math.random(1,10)

local function showAd() if randomAd == 10 then coronaAds.hide() coronaAds.show(interstitialPlacement, true) elseif randomAd == 5 or randomAd == 6 or randomAd == 7 or randomAd == 8 or randomAd == 9 then coronaAds.hide() coronaAds.show(bannerPlacement, false) print("entered ad phase 5-9") end end

coronaAds.init("9b883af3-c5b3-41ab-8507-027207b740e8", adListener)

And again, always a thank you for those who take the time to help me out.

Are you getting any messages in your device’s console log that could indicate the problem?

If you need help with that, please read:  https://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

The only error I get is when I give the player a boost, I get a translation error.  Nothing restart screen related, nor ad related. But here’s something:

Screen%20Shot%202016-11-15bleh_zpsjxryoo

Screen%20Shot%202016-11-15%20at%2010.46.

I have every iOS sdks installed back to like 8, it still builds though.

Any ideas?

Also just now noticed that I went from like 25 ad requests, to 1875 ad requests over night while testing this out. um… what?

So the error you posted above, well it’s a warning. But you have to have a matching version of Xcode to the iOS SDK version you’re selecting from the drop down. It looks like you have Xcode 8.1 installed since it’s finding the iOS 10.1 SDK, but the version of Corona SDK you’re using is looking for either iOS 9.3 or 10.0 (which means having Xcode 7.3 or Xcode 8.0 installed). The easiest solution to this is to update your Corona SDK to the latest daily build (2992). This has nothing to do with your ads not showing up.

Next, your translation error also has nothing to do with your ads not showing up. But if you want to trouble shoot that I would suggest starting a new thread so this thread stays focused on your ad issues.

Finally, I’m not sure I made myself clear in the previous post. You need to plug your phone into your computer via it’s USB charging code and then run your app. Use Xcode’s Devices option to click on your device and look through the output from your phone or iPad and look for error messages in that output. Since you’re using macOS, Corona’s build window can conveniently build and install on your device for you. If you do not close the dialog that comes up, then your device’s messages will be routed to the Corona Console window for you. You need to look in that mass if messages coming from the device for related messages from CoronaAds. 

To help make this a better help, you can put “print” statements in your listener call back function

local json = require("json") -- can go near the top of the code if you're not already doing this local function adListener(event) print( json.prettify( event ) ) if (event.phase == "init") then showAd() elseif ( event.phase == "request" ) then local adText = display.newText("An Add Was Requested", 30, 30, "Impact", 40) elseif ( event.phase == "found" ) then local adText1 = display.newText("An ad was found", 30, 40, "Impact", 40) elseif ( event.phase == "shown" ) then local adText2 = display.newText("The ad has shown", 30, 50, "Impact", 40) elseif ( event.phase == "closed" or event.phase == "failed" ) then local adText3 = display.newText("An ad was closed/hidden, or an ad could not be found", 30, 60, "Impact", 40) end end

This will dump the results of the event table which may contain error messages. Until you know this information or other messages coming from CoronaAds in your console log, you’re just shooting in the dark trying to solve this.

The jump from 25 to 1875 does seem a bit suspect. Have you made your app available to testers? 

Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: init success happend Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: BALLL SACKSSS Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: { "name":"corona\_ads\_event", "phase":"init", "provider":"coronaAds", "isError":false } Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: BALLL SACKSSS EQUALS 10 Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: toggle button 1 Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: placement ID = interstitial-1 Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: plc ID = (null) Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: BALLL SACKSSS Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: { "name":"corona\_ads\_event", "phase":"request", "placementId":"interstitial-1", "provider":"coronaAds", "isError":false } Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: Info/GA/Analytics: Add ERROR event: {severity:debug, message:Ad requested} Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: adValuesDic = { dimensions = 320x480; "fan\_placement\_id" = "659428974189956\_731309447001908"; id = 2713; networks = ( { fan = "659428974189956\_731309447001908"; } ); position = center; slug = "interstitial-1"; type = interstitial; } Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: \_placementIDValue = interstitial-1 Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: AD PLC VALUE Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: THE BALLL SACKSSS RETURNS Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: ---{ "Cache-Control" = "private, must-revalidate"; Connection = "keep-alive"; "Content-Type" = "application/json"; Date = "Wed, 16 Nov 2016 01:15:36 GMT"; Expires = "-1"; "Keep-Alive" = "timeout=10"; Pragma = "no-cache"; Server = nginx; "Transfer-Encoding" = Identity; "X-Powered-By" = "PHP/5.6.16"; } Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: SDK is initialized Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: Info/GA/Analytics: Event added to queue: {"device":"iPhone9,2","engine\_version":"corona 2016.2949","build":"1.1.0","message":"Ad requested","ios\_idfa":"3A5CDD54-9E6F-4DC8-9771-338989BABEF7","category":"error","sdk\_version":"corona 1.0.1","user\_id":"3A5CDD54-9E6F-4DC8-9771-338989BABEF7","session\_num":1,"platform":"ios","connection\_type":"wifi","manufacturer":"apple","client\_ts":1479258936,"severity":"debug","session\_id":"ad011898-3776-42ca-a066-ebd14f45330f","ios\_idfv":"2CB4CC10-919F-4094-ABEB-9618506E74CB","os\_version":"ios 10.1.1","v":2}

Please disregard ‘BALL SACKS’ that was a print to find these issues.

 

Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: ad response: { error = { error = { }; }; } Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: stopFindingLocation Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: advertCountWithWaterFall = 4 Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: AD PLC VALUE Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: SDK is initialized Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: [FBAudienceNetworkLog/FBAdProvider:146 \<error\>] Ad request error: Error Domain=com.facebook.ads.sdk Code=1002 "Ad was re-loaded too frequently" UserInfo={NSLocalizedDescription=Ad was re-loaded too frequently, FBAdErrorDetailKey={ }} Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: placement ID = interstitial-1 Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: plc ID = 659428974189956\_731309447001908 Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: BALLL SACKSSS Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: { "identifier":"659428974189956\_731309447001908", "name":"corona\_ads\_event", "phase":"failed", "placementId":"interstitial-1", "provider":"coronaAds", "isError":false } Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: AD PLC VALUE Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: Info/GA/Analytics: Add ERROR event: {severity:debug, message:Ad failed} Nov 15 20:15:38 N locationd[63] \<Notice\>: message 'kCLConnectionMessageLocation' received from client 'SpeedyBird' Nov 15 20:15:38 N locationd[63] \<Notice\>: Client SpeedyBird (0x12a872c00) is unsubscribing to notification kCLConnectionMessageLocation Nov 15 20:15:38 N locationd[63] \<Notice\>: Client SpeedyBird (0x12a872c00) is unsubscribing to notification kCLConnectionMessageLocationUnavailable Nov 15 20:15:38 N locationd[63] \<Notice\>: client 'SpeedyBird' unsubscribing from location Nov 15 20:15:38 N locationd[63] \<Info\>: ClxClient, unsubscribe, \<private\> Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: Info/GA/Analytics: Event added to queue: {"device":"iPhone9,2","engine\_version":"corona 2016.2949","build":"1.1.0","message":"Ad failed","ios\_idfa":"3A5CDD54-9E6F-4DC8-9771-338989BABEF7","category":"error","sdk\_version":"corona 1.0.1","user\_id":"3A5CDD54-9E6F-4DC8-9771-338989BABEF7","session\_num":1,"platform":"ios","connection\_type":"wifi","manufacturer":"apple","client\_ts":1479258938,"severity":"debug","session\_id":"ad011898-3776-42ca-a066-ebd14f45330f","ios\_idfv":"2CB4CC10-919F-4094-ABEB-9618506E74CB","os\_version":"ios 10.1.1","v":2}

So we see the initialize failing, and it’s saying it’s being called too frequently. 

I’ve asked an engineer to look into this.

Rob

Hello neviah,

I see that your app, Speedy Bird, is not configured for iOS. Right now it is configured for only Android, using the bundle ID com.gmail.neviah.SpeedyBird.

The fastest fix is to update your app settings on Corona Ads dashboard. Go to “My Apps” and “Edit”. On the Edit App page enable iOS, give us a day to set it up on our side and you should start seeing ads on iOS too.

Regards,

Vamsee

Done and done, thank you so much. Now waiting.

All set from our side too, neviah. Speedy Bird should now be receiving ads on iOS. It might take up to 48 hours before there is consistent high fill but you should start seeing few live ads right away.

Thanks for your patience through this.

vamsee

Are you getting any messages in your device’s console log that could indicate the problem?

If you need help with that, please read:  https://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

The only error I get is when I give the player a boost, I get a translation error.  Nothing restart screen related, nor ad related. But here’s something:

Screen%20Shot%202016-11-15bleh_zpsjxryoo

Screen%20Shot%202016-11-15%20at%2010.46.

I have every iOS sdks installed back to like 8, it still builds though.

Any ideas?

Also just now noticed that I went from like 25 ad requests, to 1875 ad requests over night while testing this out. um… what?

So the error you posted above, well it’s a warning. But you have to have a matching version of Xcode to the iOS SDK version you’re selecting from the drop down. It looks like you have Xcode 8.1 installed since it’s finding the iOS 10.1 SDK, but the version of Corona SDK you’re using is looking for either iOS 9.3 or 10.0 (which means having Xcode 7.3 or Xcode 8.0 installed). The easiest solution to this is to update your Corona SDK to the latest daily build (2992). This has nothing to do with your ads not showing up.

Next, your translation error also has nothing to do with your ads not showing up. But if you want to trouble shoot that I would suggest starting a new thread so this thread stays focused on your ad issues.

Finally, I’m not sure I made myself clear in the previous post. You need to plug your phone into your computer via it’s USB charging code and then run your app. Use Xcode’s Devices option to click on your device and look through the output from your phone or iPad and look for error messages in that output. Since you’re using macOS, Corona’s build window can conveniently build and install on your device for you. If you do not close the dialog that comes up, then your device’s messages will be routed to the Corona Console window for you. You need to look in that mass if messages coming from the device for related messages from CoronaAds. 

To help make this a better help, you can put “print” statements in your listener call back function

local json = require("json") -- can go near the top of the code if you're not already doing this local function adListener(event) print( json.prettify( event ) ) if (event.phase == "init") then showAd() elseif ( event.phase == "request" ) then local adText = display.newText("An Add Was Requested", 30, 30, "Impact", 40) elseif ( event.phase == "found" ) then local adText1 = display.newText("An ad was found", 30, 40, "Impact", 40) elseif ( event.phase == "shown" ) then local adText2 = display.newText("The ad has shown", 30, 50, "Impact", 40) elseif ( event.phase == "closed" or event.phase == "failed" ) then local adText3 = display.newText("An ad was closed/hidden, or an ad could not be found", 30, 60, "Impact", 40) end end

This will dump the results of the event table which may contain error messages. Until you know this information or other messages coming from CoronaAds in your console log, you’re just shooting in the dark trying to solve this.

The jump from 25 to 1875 does seem a bit suspect. Have you made your app available to testers? 

Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: init success happend Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: BALLL SACKSSS Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: { "name":"corona\_ads\_event", "phase":"init", "provider":"coronaAds", "isError":false } Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: BALLL SACKSSS EQUALS 10 Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: toggle button 1 Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: placement ID = interstitial-1 Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: plc ID = (null) Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: BALLL SACKSSS Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: { "name":"corona\_ads\_event", "phase":"request", "placementId":"interstitial-1", "provider":"coronaAds", "isError":false } Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: Info/GA/Analytics: Add ERROR event: {severity:debug, message:Ad requested} Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: adValuesDic = { dimensions = 320x480; "fan\_placement\_id" = "659428974189956\_731309447001908"; id = 2713; networks = ( { fan = "659428974189956\_731309447001908"; } ); position = center; slug = "interstitial-1"; type = interstitial; } Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: \_placementIDValue = interstitial-1 Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: AD PLC VALUE Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: THE BALLL SACKSSS RETURNS Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: ---{ "Cache-Control" = "private, must-revalidate"; Connection = "keep-alive"; "Content-Type" = "application/json"; Date = "Wed, 16 Nov 2016 01:15:36 GMT"; Expires = "-1"; "Keep-Alive" = "timeout=10"; Pragma = "no-cache"; Server = nginx; "Transfer-Encoding" = Identity; "X-Powered-By" = "PHP/5.6.16"; } Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: SDK is initialized Nov 15 20:15:36 N SpeedyBird[1743] \<Notice\>: Info/GA/Analytics: Event added to queue: {"device":"iPhone9,2","engine\_version":"corona 2016.2949","build":"1.1.0","message":"Ad requested","ios\_idfa":"3A5CDD54-9E6F-4DC8-9771-338989BABEF7","category":"error","sdk\_version":"corona 1.0.1","user\_id":"3A5CDD54-9E6F-4DC8-9771-338989BABEF7","session\_num":1,"platform":"ios","connection\_type":"wifi","manufacturer":"apple","client\_ts":1479258936,"severity":"debug","session\_id":"ad011898-3776-42ca-a066-ebd14f45330f","ios\_idfv":"2CB4CC10-919F-4094-ABEB-9618506E74CB","os\_version":"ios 10.1.1","v":2}

Please disregard ‘BALL SACKS’ that was a print to find these issues.

 

Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: ad response: { error = { error = { }; }; } Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: stopFindingLocation Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: advertCountWithWaterFall = 4 Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: AD PLC VALUE Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: SDK is initialized Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: [FBAudienceNetworkLog/FBAdProvider:146 \<error\>] Ad request error: Error Domain=com.facebook.ads.sdk Code=1002 "Ad was re-loaded too frequently" UserInfo={NSLocalizedDescription=Ad was re-loaded too frequently, FBAdErrorDetailKey={ }} Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: placement ID = interstitial-1 Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: plc ID = 659428974189956\_731309447001908 Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: BALLL SACKSSS Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: { "identifier":"659428974189956\_731309447001908", "name":"corona\_ads\_event", "phase":"failed", "placementId":"interstitial-1", "provider":"coronaAds", "isError":false } Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: AD PLC VALUE Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: Info/GA/Analytics: Add ERROR event: {severity:debug, message:Ad failed} Nov 15 20:15:38 N locationd[63] \<Notice\>: message 'kCLConnectionMessageLocation' received from client 'SpeedyBird' Nov 15 20:15:38 N locationd[63] \<Notice\>: Client SpeedyBird (0x12a872c00) is unsubscribing to notification kCLConnectionMessageLocation Nov 15 20:15:38 N locationd[63] \<Notice\>: Client SpeedyBird (0x12a872c00) is unsubscribing to notification kCLConnectionMessageLocationUnavailable Nov 15 20:15:38 N locationd[63] \<Notice\>: client 'SpeedyBird' unsubscribing from location Nov 15 20:15:38 N locationd[63] \<Info\>: ClxClient, unsubscribe, \<private\> Nov 15 20:15:38 N SpeedyBird[1743] \<Notice\>: Info/GA/Analytics: Event added to queue: {"device":"iPhone9,2","engine\_version":"corona 2016.2949","build":"1.1.0","message":"Ad failed","ios\_idfa":"3A5CDD54-9E6F-4DC8-9771-338989BABEF7","category":"error","sdk\_version":"corona 1.0.1","user\_id":"3A5CDD54-9E6F-4DC8-9771-338989BABEF7","session\_num":1,"platform":"ios","connection\_type":"wifi","manufacturer":"apple","client\_ts":1479258938,"severity":"debug","session\_id":"ad011898-3776-42ca-a066-ebd14f45330f","ios\_idfv":"2CB4CC10-919F-4094-ABEB-9618506E74CB","os\_version":"ios 10.1.1","v":2}

So we see the initialize failing, and it’s saying it’s being called too frequently. 

I’ve asked an engineer to look into this.

Rob

Hello neviah,

I see that your app, Speedy Bird, is not configured for iOS. Right now it is configured for only Android, using the bundle ID com.gmail.neviah.SpeedyBird.

The fastest fix is to update your app settings on Corona Ads dashboard. Go to “My Apps” and “Edit”. On the Edit App page enable iOS, give us a day to set it up on our side and you should start seeing ads on iOS too.

Regards,

Vamsee

Done and done, thank you so much. Now waiting.

All set from our side too, neviah. Speedy Bird should now be receiving ads on iOS. It might take up to 48 hours before there is consistent high fill but you should start seeing few live ads right away.

Thanks for your patience through this.

vamsee