iADs set up

I try to set up iAds.

I want to place the iAd banner at the bottom of the screen.

Is it allowed to do that?

I have this function. I test in the device.

If the iAds is not showed, I have this text        “error showing the iAds”

I place the code in the menu screen.

When I go to other levels , I still see the text "  “error showing the iAds”

The text didnt disapear

[lua]

local function adListener( event )

– event table includes:

– event.provider

– event.isError (e.g. true/false )

– event.response - the localized description of the event (error or confirmation message)

local msg = event.response

– just a quick debug message to check what response we got from the library

print("Message received from the ads library: ", msg)

if event.isError then

–statusText:setTextColor( 255, 0, 0 )

–statusText.text = msg

local myText = display.newText( “error showing the iAds”, 100, 200, native.systemFont, 16 )

 myText:setFillColor( 1, 0, 0 )

else

–statusText:setTextColor( 0, 255, 0 )

–statusText.text = msg

end

end

[/lua]

If you’re using a scene manager like Composer or Storyboard, you have to put your display objects (in this case your display.newText() ) into the scene’s view “group”.

I see this.

Important:  If your app does not include the proper delegate to handle errors, it will be rejected by the App Review Team.

How can I implement that.?

I place in the group of the scene, it works  When I go to other level it disappears, that is ok. 

But when  I am in another  level and the iads  says there is no inventory, the text appears  again.and then it doesn’t disappears.

I place the code in the menu scene.

  1. local myText = display.newText( “error showing the iAds”, 100, 200, native.systemFont, 16 )
  2.  
  3.  myText:setFillColor( 1, 0, 0 )
  1. The error delegate.  We have that taken care of.  This is why you get a callback function letting you know if its an error or not.

  2. the text appearing… are you creating that in your call back handler?  If so you have to get it into the scene’s group if you want the scene to maintain it.  But frankly, I’m not sure why this is important.  Normally you would not show the app’s user a message like that, they just wouldn’t get the ad.  The idea in the event listener is that you could call another ad provider to get an add to fill out your inventory.

Well I try to set up iAd , I read some corona docs, an I use this code

I put this code to the menu Scene.I use storyboard.

local ads = require “ads”

local function adListener( event )
local msg = event.response
if event.isError then
– Failed to receive an ad, we print the error message returned from the library.
print(msg)
end
end

ads.init( “iads”, “myAppId”, adListener )–I put in “myAppID” my iOS bundle.
ads.show( “banner”, { x=0, y=0 } )

I test in the device and I can see the iAds.

Can I submit to the AppStore with thiss code or Do I have to put something in the even.error?

You don’t have to put anything in the if event.error the n block.  You could if you wanted have a back up ad service like Inneractive, inMobi, AdMob, etc. and if you failed to get ads from iAd, you could try to get an ad from a different provider.  But that’s purely optional.

Rob

If you’re using a scene manager like Composer or Storyboard, you have to put your display objects (in this case your display.newText() ) into the scene’s view “group”.

I see this.

Important:  If your app does not include the proper delegate to handle errors, it will be rejected by the App Review Team.

How can I implement that.?

I place in the group of the scene, it works  When I go to other level it disappears, that is ok. 

But when  I am in another  level and the iads  says there is no inventory, the text appears  again.and then it doesn’t disappears.

I place the code in the menu scene.

  1. local myText = display.newText( “error showing the iAds”, 100, 200, native.systemFont, 16 )
  2.  
  3.  myText:setFillColor( 1, 0, 0 )
  1. The error delegate.  We have that taken care of.  This is why you get a callback function letting you know if its an error or not.

  2. the text appearing… are you creating that in your call back handler?  If so you have to get it into the scene’s group if you want the scene to maintain it.  But frankly, I’m not sure why this is important.  Normally you would not show the app’s user a message like that, they just wouldn’t get the ad.  The idea in the event listener is that you could call another ad provider to get an add to fill out your inventory.

Well I try to set up iAd , I read some corona docs, an I use this code

I put this code to the menu Scene.I use storyboard.

local ads = require “ads”

local function adListener( event )
local msg = event.response
if event.isError then
– Failed to receive an ad, we print the error message returned from the library.
print(msg)
end
end

ads.init( “iads”, “myAppId”, adListener )–I put in “myAppID” my iOS bundle.
ads.show( “banner”, { x=0, y=0 } )

I test in the device and I can see the iAds.

Can I submit to the AppStore with thiss code or Do I have to put something in the even.error?

You don’t have to put anything in the if event.error the n block.  You could if you wanted have a back up ad service like Inneractive, inMobi, AdMob, etc. and if you failed to get ads from iAd, you could try to get an ad from a different provider.  But that’s purely optional.

Rob