I need help with iads (and other adds I can add to my app)

Hello, I am new here.

I am trying to put ads on my app, but I don’t seem to get it work. It didn’t appear in the simulator, nor on my device.

The biggest problem is, for some reason, when I put any ads code in my project, it stops working on my device (but still works on my corona simulator)

Please see below is my build setting (the plugin part):

    plugins =

    {

        [“CoronaProvider.ads.iads”] =

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { iphone=true, [“iphone-sim”]=true },

        },

    }, 

and below is the few codes I put in my main.lua:

local ads = require(“ads”)

ads.init( “iads”, “com.xxxx.xxxx” )

ads.show( “banner”, {x=centerX, y=centerY} )

only with or without this 3 lines will make my app stop working on my iphone5. Any idea why this happen?

Thanks in advance for your help!

What error messages are you seeing in your device’s console log?  Most ad providers do not work in the simulator.  If you need help with finding your console log see:  http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Hello Rob, thank you for your reply.

I was testing it on my iphone5 so I don’t see the error. I tried to wipe out all the options and keep it as simple as I can, just putting in the build setting this:

    plugins =      {         ["CoronaProvider.ads.iads"] =         {             publisherId = "com.coronalabs",             supportedPlatforms = { iphone = true },         },     }  

and left only these in my main.lua:

local ads = require("ads") ads.init( "iads", "com.xxxx.xxxxx") ads.show( "banner", { x = 0, y = 0 } )  

the app loads, but the ads still didn’t show up on my iphone5. Normally just these will make it appears, am I right? (I have already set everything up at itunesconnect)

Hi, sorry, I got what you meant now. Just plugin my phone and opened the console. It gives me the following error:

ERROR: Could not load provider (iads) due to the following reason: module ‘CoronaProvider.ads.iads’ not found:resource (CoronaProvider.ads.iads.lu) does not exist in archive

        no field package.preload[‘CoronaProvider.ads.iads’]

        no file ‘/var/mobile/Applications/19F20555-D67D-4478-B277-8666CE8DC042/hiragana.app/CoronaProvider.ads.iads.lua’

        no file ‘/var/mobile/Applications/19F20555-D67D-4478-B277-8666CE8DC042/hiragana.app/CoronaProvider.ads.iads.lua’

        no file ‘./CoronaProvider.ads.iads.so’

        no file ‘/var/mobile/Applications/19F20555-D67D-4478-B277-8666CE8DC042/hiragana.app/CoronaProvider.ads.iads.so’

        no file ‘./CoronaProvider.so’

        no file '/var/mobile/Applications/19F20555-D67D-4478-B277-8666CE8DC042/hiragana.app/CoronaProvider.so’CoronaProvider.ads.iads.

    stack traceback:

        [C]: ?

        [C]: in function ‘assert’

        ?: in function ‘requireProvider’

        ?: in function ‘setCurrentProvider’

        ?: in function ‘init’

        /Users/mac/Downloads/hiragana/main.lua:136: in main chunk

Apr 13 09:49:56 renahime hiragana[2601] <Warning>: Runtime error

    

    stack traceback:

        [C]: ?

        [C]: in function ‘assert’

        ?: in function ‘requireProvider’

        ?: in function ‘setCurrentProvider’

        ?: in function ‘init’

        /Users/mac/Downloads/hiragana/main.lua:136: in main chunk

Apr 13 09:49:57 renahime medialibraryd[98] <Warning>: {MediaLibrary} [MediaLibraryService] Cancelling any active or suspended import operations in progress for process <unknown process> (process ID = 2565)

Apr 13 09:49:57 renahime medialibraryd[98] <Warning>: {MediaLibrary} [MLWriter] Cleaning up any remaining transactions for ended process <unknown process> (process ID = 2565)

Apr 13 09:49:58 renahime kernel[0] <Debug>: 117593.226485 wlan.A[26273] AppleBCMWLANProximityInterface::handleAWDLOffTimer(): Generated new AWDL MAC F6:5E:90:90:43:97 last 19015 (sec) now 117593.226299166

Apr 13 09:49:58 renahime configd[56] <Notice>: network changed.

So this: “module ‘CoronaProvider.ads.iads’ not found:resource (CoronaProvider.ads.iads.lu) does not exist in archive” is the reason? How should I fix that? Thanks!

Can you post your whole build.settings file?

Hi, here it is:

settings = { &nbsp;&nbsp;&nbsp;&nbsp;orientation = &nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default ="portrait", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;supported = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"portrait","portraitUpsideDown" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}, &nbsp;&nbsp;&nbsp;&nbsp;}, &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; plugins =&nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; ["CoronaProvider.ads.iads"] = &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; publisherId = "com.coronalabs", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; supportedPlatforms = { iphone = true }, &nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; } } &nbsp;

Can you build the iAds sample app?

Do you mean this one? https://github.com/coronalabs/plugins-sample-ads-iAds

I just put it in my device and it does work… I see the ad banner…

Now it looks like it is something to do with my appID, because after I change it to mine, the banner stopped showing and I have this message in the console:

Apr 14 09:37:48 renahime kernel[0] <Debug>: launchd[2963] Container: /private/var/mobile/Applications/xxxxx (sandbox)

Apr 14 09:37:48 renahime backboardd[28] <Error>: HID: The ‘Passive’ connection ‘13’ access to protected services is denied.

Apr 14 09:37:55 renahime limitadtrackingd[2783] <Warning>: Lost connection from Limit Ad Tracking client.

Apr 14 09:37:55 renahime backboardd[28] <Error>: HID: The ‘Passive’ connection ‘AdSheet’ access to protected services is denied.

Apr 14 09:37:56 renahime limitadtrackingd[2783] <Warning>: Not scheduling a new BTA job; keeping previously scheduled job should run after 54000s from now when the network is available.

Apr 14 09:37:56 renahime AdSheet[2964] <Warning>: [AppDeveloper] Fill rate for development application ‘com.applebat.hiraganatap’: 80.0%

Apr 14 09:37:56 renahime AdSheet[2964] <Warning>: [AppDeveloper] Simulating an inventory-unavailable server response due to development application fill rate. To change the fill rate, see the Developer panel in Settings.

Apr 14 09:37:56 renahime 13[2963] <Warning>: Message received from the ads library:     The operation couldn’t be completed. Ad inventory unavailable

any idea how I can fix this? Thanks!

The key is this message:

 Simulating an inventory-unavailable server response due to development application fill rate. To change the fill rate, see the Developer panel in Settings.

Start the Settings app and scroll down to the Developer section.

In the “IAD DEVELOPER APP TESTING” section change the Fill rate to 100%.

It should then provide an ad.

Thank you so much for all your help!

I still can’t get the code I wrote to work, but finally I can borrow the sample code, edit it a bit to make the ad show up! :smiley:

What error messages are you seeing in your device’s console log?  Most ad providers do not work in the simulator.  If you need help with finding your console log see:  http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Hello Rob, thank you for your reply.

I was testing it on my iphone5 so I don’t see the error. I tried to wipe out all the options and keep it as simple as I can, just putting in the build setting this:

&nbsp; &nbsp; plugins =&nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; ["CoronaProvider.ads.iads"] = &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; publisherId = "com.coronalabs", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; supportedPlatforms = { iphone = true }, &nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; } &nbsp;

and left only these in my main.lua:

local ads = require("ads") ads.init( "iads", "com.xxxx.xxxxx") ads.show( "banner", { x = 0, y = 0 } ) &nbsp;

the app loads, but the ads still didn’t show up on my iphone5. Normally just these will make it appears, am I right? (I have already set everything up at itunesconnect)

Hi, sorry, I got what you meant now. Just plugin my phone and opened the console. It gives me the following error:

ERROR: Could not load provider (iads) due to the following reason: module ‘CoronaProvider.ads.iads’ not found:resource (CoronaProvider.ads.iads.lu) does not exist in archive

        no field package.preload[‘CoronaProvider.ads.iads’]

        no file ‘/var/mobile/Applications/19F20555-D67D-4478-B277-8666CE8DC042/hiragana.app/CoronaProvider.ads.iads.lua’

        no file ‘/var/mobile/Applications/19F20555-D67D-4478-B277-8666CE8DC042/hiragana.app/CoronaProvider.ads.iads.lua’

        no file ‘./CoronaProvider.ads.iads.so’

        no file ‘/var/mobile/Applications/19F20555-D67D-4478-B277-8666CE8DC042/hiragana.app/CoronaProvider.ads.iads.so’

        no file ‘./CoronaProvider.so’

        no file '/var/mobile/Applications/19F20555-D67D-4478-B277-8666CE8DC042/hiragana.app/CoronaProvider.so’CoronaProvider.ads.iads.

    stack traceback:

        [C]: ?

        [C]: in function ‘assert’

        ?: in function ‘requireProvider’

        ?: in function ‘setCurrentProvider’

        ?: in function ‘init’

        /Users/mac/Downloads/hiragana/main.lua:136: in main chunk

Apr 13 09:49:56 renahime hiragana[2601] <Warning>: Runtime error

    

    stack traceback:

        [C]: ?

        [C]: in function ‘assert’

        ?: in function ‘requireProvider’

        ?: in function ‘setCurrentProvider’

        ?: in function ‘init’

        /Users/mac/Downloads/hiragana/main.lua:136: in main chunk

Apr 13 09:49:57 renahime medialibraryd[98] <Warning>: {MediaLibrary} [MediaLibraryService] Cancelling any active or suspended import operations in progress for process <unknown process> (process ID = 2565)

Apr 13 09:49:57 renahime medialibraryd[98] <Warning>: {MediaLibrary} [MLWriter] Cleaning up any remaining transactions for ended process <unknown process> (process ID = 2565)

Apr 13 09:49:58 renahime kernel[0] <Debug>: 117593.226485 wlan.A[26273] AppleBCMWLANProximityInterface::handleAWDLOffTimer(): Generated new AWDL MAC F6:5E:90:90:43:97 last 19015 (sec) now 117593.226299166

Apr 13 09:49:58 renahime configd[56] <Notice>: network changed.

So this: “module ‘CoronaProvider.ads.iads’ not found:resource (CoronaProvider.ads.iads.lu) does not exist in archive” is the reason? How should I fix that? Thanks!

Can you post your whole build.settings file?

Hi, here it is:

settings = { &nbsp;&nbsp;&nbsp;&nbsp;orientation = &nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default ="portrait", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;supported = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"portrait","portraitUpsideDown" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}, &nbsp;&nbsp;&nbsp;&nbsp;}, &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; plugins =&nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; ["CoronaProvider.ads.iads"] = &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; publisherId = "com.coronalabs", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; supportedPlatforms = { iphone = true }, &nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; } } &nbsp;

Can you build the iAds sample app?

Do you mean this one? https://github.com/coronalabs/plugins-sample-ads-iAds

I just put it in my device and it does work… I see the ad banner…

Now it looks like it is something to do with my appID, because after I change it to mine, the banner stopped showing and I have this message in the console:

Apr 14 09:37:48 renahime kernel[0] <Debug>: launchd[2963] Container: /private/var/mobile/Applications/xxxxx (sandbox)

Apr 14 09:37:48 renahime backboardd[28] <Error>: HID: The ‘Passive’ connection ‘13’ access to protected services is denied.

Apr 14 09:37:55 renahime limitadtrackingd[2783] <Warning>: Lost connection from Limit Ad Tracking client.

Apr 14 09:37:55 renahime backboardd[28] <Error>: HID: The ‘Passive’ connection ‘AdSheet’ access to protected services is denied.

Apr 14 09:37:56 renahime limitadtrackingd[2783] <Warning>: Not scheduling a new BTA job; keeping previously scheduled job should run after 54000s from now when the network is available.

Apr 14 09:37:56 renahime AdSheet[2964] <Warning>: [AppDeveloper] Fill rate for development application ‘com.applebat.hiraganatap’: 80.0%

Apr 14 09:37:56 renahime AdSheet[2964] <Warning>: [AppDeveloper] Simulating an inventory-unavailable server response due to development application fill rate. To change the fill rate, see the Developer panel in Settings.

Apr 14 09:37:56 renahime 13[2963] <Warning>: Message received from the ads library:     The operation couldn’t be completed. Ad inventory unavailable

any idea how I can fix this? Thanks!

The key is this message:

 Simulating an inventory-unavailable server response due to development application fill rate. To change the fill rate, see the Developer panel in Settings.

Start the Settings app and scroll down to the Developer section.

In the “IAD DEVELOPER APP TESTING” section change the Fill rate to 100%.

It should then provide an ad.