iAd and map issue

I am using  mapview in my application. But since I implemented iAd in the application, the map does not seem to respond to user input (cannot drag map or zoom).

Is there an issue with iAd and mapview?

<code>
    local ads = require “ads”

    ads.init(“iads”, “com.mobileinterlude.myapp”)
    ads.show (“banner”, { x=0, y=0 })    
    
    myMap = native.newMapView (0, 0, display.contentWidth, display.contentHeight)
    myMap.mapType = “standard”
    
    myMap: setCenter (48.860897797941035, 2.29559959844703)    
</code>
 

Do you have a sample project that exhibits this problem(including the build.settings, config.lua, etc.)?  Also what device and version of iOS are you running this on?

build.settings

settings = { orientation = { default = "portrait", supported = {"portraitUpsideDown"}, }, iphone = { plist = { UIApplicationExitsOnSuspend = false, CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon-60.png" , "Icon-72.png" , "Icon-72@2x.png" , "Icon-76.png" , "Icon-76@2x.png" , "Icon-512.png" , "Icon-1024.png" , "Icon-Small-50.png" , "Icon-Small-50@2x.png" , "Icon-Small.png" , "Icon-Small@2x.png" , "Icon.png" , "Icon@2x.png" }, CFBundleVersion = "1.0", MinimumOSVersion = "5.0", }, }, plugins = { -- key is the name passed to Lua's 'require()' ["CoronaProvider.ads.iads"] = { -- required publisherId = "com.coronalabs", }, }, }

config.lua

local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 320 or math.ceil( 480 / aspectRatio ), height = aspectRatio \< 1.5 and 480 or math.ceil( 320 \* aspectRatio ), scale = "letterBox", fps = 30, imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, }

main.lua

 local ads = require "ads" -- Step 1 : initialise and show ad ads.init("iads", "com.mobileinterlude.myapp") ads.show ("banner", { x=0, y=0 }) -- Step 2: create map myMap = native.newMapView (0, 0, display.contentWidth, display.contentHeight) myMap.mapType = "standard" myMap: setCenter (48.860897797941035, 2.29559959844703) 

I am using :

  • Corona Version 2013.1244 (2013.10.25) 

  • Xcode Version 5.0 (5A1413)

  • And tested it on an iPad and iPod touch with version 6.1.3

Test 1

I initialise and show ads first. Then create a map.

What happen is that the ads is created but it is behind the map and not visible.

Test 2

I did another test by creating the map first and then initialize and show ad.  

The ad is displayed on top of the map. But I cannot interact (zoom, drag) with the map.

Hello, I did another test with the sample iAds code in the sdk with the latest build Version 2013.1256 (2013.11.6).

I added the following line at the end of the main.lua file

 myMap = native.newMapView (0, 50, display.contentWidth, 120) myMap.mapType = "standard" myMap: setCenter (48.860897797941035, 2.29559959844703) 

I can zoom and drag the map.

But as soon as I click on ‘Show Banner’ button, I can no longer interact with the map.

Seems that there is something wrong with ads.show and map.

Hi,

This issue has been fixed in the plugin.  Please build your project again by creating the map view first and then showing the ad.

Hi @Lourenco,

Do you have public build #1202 to test this with? If so, can you quickly build the project and see if the behavior is the same?

Thanks,

Brent

Thank you Corona Team for fixing this issue.

Works fine now.

Do you have a sample project that exhibits this problem(including the build.settings, config.lua, etc.)?  Also what device and version of iOS are you running this on?

build.settings

settings = { orientation = { default = "portrait", supported = {"portraitUpsideDown"}, }, iphone = { plist = { UIApplicationExitsOnSuspend = false, CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon-60.png" , "Icon-72.png" , "Icon-72@2x.png" , "Icon-76.png" , "Icon-76@2x.png" , "Icon-512.png" , "Icon-1024.png" , "Icon-Small-50.png" , "Icon-Small-50@2x.png" , "Icon-Small.png" , "Icon-Small@2x.png" , "Icon.png" , "Icon@2x.png" }, CFBundleVersion = "1.0", MinimumOSVersion = "5.0", }, }, plugins = { -- key is the name passed to Lua's 'require()' ["CoronaProvider.ads.iads"] = { -- required publisherId = "com.coronalabs", }, }, }

config.lua

local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 320 or math.ceil( 480 / aspectRatio ), height = aspectRatio \< 1.5 and 480 or math.ceil( 320 \* aspectRatio ), scale = "letterBox", fps = 30, imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, }

main.lua

 local ads = require "ads" -- Step 1 : initialise and show ad ads.init("iads", "com.mobileinterlude.myapp") ads.show ("banner", { x=0, y=0 }) -- Step 2: create map myMap = native.newMapView (0, 0, display.contentWidth, display.contentHeight) myMap.mapType = "standard" myMap: setCenter (48.860897797941035, 2.29559959844703) 

I am using :

  • Corona Version 2013.1244 (2013.10.25) 

  • Xcode Version 5.0 (5A1413)

  • And tested it on an iPad and iPod touch with version 6.1.3

Test 1

I initialise and show ads first. Then create a map.

What happen is that the ads is created but it is behind the map and not visible.

Test 2

I did another test by creating the map first and then initialize and show ad.  

The ad is displayed on top of the map. But I cannot interact (zoom, drag) with the map.

Hello, I did another test with the sample iAds code in the sdk with the latest build Version 2013.1256 (2013.11.6).

I added the following line at the end of the main.lua file

 myMap = native.newMapView (0, 50, display.contentWidth, 120) myMap.mapType = "standard" myMap: setCenter (48.860897797941035, 2.29559959844703) 

I can zoom and drag the map.

But as soon as I click on ‘Show Banner’ button, I can no longer interact with the map.

Seems that there is something wrong with ads.show and map.

Hi,

This issue has been fixed in the plugin.  Please build your project again by creating the map view first and then showing the ad.

Hi @Lourenco,

Do you have public build #1202 to test this with? If so, can you quickly build the project and see if the behavior is the same?

Thanks,

Brent

Thank you Corona Team for fixing this issue.

Works fine now.