device detection or OS detection

Trying to display slightly dividend  ads  depending on the device/os of the user :

local device = system.getInfo( "model" ) if (device == "Android") then         ads.show( "banner", { x=display.screenOriginX, y=400 } ) elseif (device == "iPad") then         ads.show( "banner", { x=display.screenOriginX, y=440 } ) elseif (device == "iPhone") then         ads.show( "banner", { x=display.screenOriginX, y=440 } )         end

&

if(system.getInfo("model") == "iPad" or system.getInfo("model") == "iPhone") then     ads.show( "banner", { x=display.screenOriginX, y=440 } ) elseif(system.getInfo("model") == "Nexus One" or system.getInfo("model") == "Droid") or system.getInfo("model") == "Galaxy Tab") then     ads.show( "banner", { x=display.screenOriginX, y=400 } ) else   print('Do something else.') end  

I have tried this code but whiteout any luck, can some one point me in the right direction? 

Kevin

got it working whit : 

local environment = system.getInfo( "platformName" ) if environment == "Mac OS X" then     print( "You're in the simulator." ) end if environment == "iPhone OS" then     ads.show( "banner", { x=display.screenOriginX, y=440 } ) end if environment == "Android" then     ads.show( "banner", { x=display.screenOriginX, y=400 } ) end  

Hi mmk.verheijden,

This tutorial may help you as well (or just use it to compare to your code):

http://www.coronalabs.com/blog/2012/12/11/device-detection-on-steroids/

Brent

got it working whit : 

local environment = system.getInfo( "platformName" ) if environment == "Mac OS X" then     print( "You're in the simulator." ) end if environment == "iPhone OS" then     ads.show( "banner", { x=display.screenOriginX, y=440 } ) end if environment == "Android" then     ads.show( "banner", { x=display.screenOriginX, y=400 } ) end  

Hi mmk.verheijden,

This tutorial may help you as well (or just use it to compare to your code):

http://www.coronalabs.com/blog/2012/12/11/device-detection-on-steroids/

Brent