ads not showing in app

hey

i am following all the steps to show ads on my app but it is not showing ads on mobile.here is the code i am using to display ads.if ads not showing because of app id then please tell me how to get one.

thanks 

{{

local Library = require “CoronaLibrary”

– Create library

local lib = Library:new{ name=‘ads’, publisherId=‘com.coronalabs’ }

ads = require( “ads” )

local function adListener( event )

if ( event.isError ) then

–Failed to receive an ad

print “Error in ads”

end

end

ads.init( “admob”,“pub-6970275851831176” , adListener)

ads.show(“banner”, { x=display.contentWidth/2, y=display.contentHeight/2,appId=“ca-app-pub-6970275851831176/7384084441”, testMode=true})

}}

Hello @osamasiddiqui04,

Where did you locate this code about including ads via “CoronaLibrary”? Most users simply include ads based on the documentation, as shown here:

http://docs.coronalabs.com/plugin/ads-admob-v2/index.html

Take care,

Brent

well Brent  i have written this code in scene show function in “will” phase.

Hi @osamasiddiqui04,

Please follow the documentation on this point: include the plugin in your build.settings file, then require() it in your other code by the “Syntax” we outline.

http://docs.coronalabs.com/plugin/ads-admob-v2/index.html

Take care,

Brent

Hi Brent thanks for the link i have followed all the steps from the api now i m only getting a black bar ( banner i think) but still not showing ads. i also checked admob account  there is no request on the site for any ad. i have changed the code little bit, plz check if i m missing anything. also i have commented "ads = require( “plugin.google.play.services” ) because error is occurring that “dll” doesnot exists.

thanks   

function scene: show(event)

local sceneGroup=self.view

local phase=event.phase

Runtime:addEventListener(“accelerometer”,listener)

Runtime:addEventListener( “orientation”, onOrientationChange )

if(phase == “will”) then

local Library = require “CoronaLibrary”

– Create library

local lib = Library:new{ name=‘ads’, publisherId=‘com.coronalabs’ }

ads = require( “ads” )

local function adListener( event )

if ( event.isError ) then

–Failed to receive an ad

print “Error in ads”

end

end

– ads = require( “plugin.google.play.services” )

ads.init( “admob”,“pub-6970275851831176” , adListener)

ads.show(“banner”, { x=display.contentWidth/2, y=display.contentHeight/2-200,appId=“ca-app-pub-6872334661207911/9697454180”, testMode=true})

Hi @osamasiddiqui04,

As I mentioned earlier, please follow the setup in the documentation for AdMob v2. This has been proven to work for many developers, so you should use the same model.

Take care,

Brent

hi

brent i need to know if it is really necessary that app should be on some kind of store to show ads on device 

thanks.

Hi @osamasiddiqui04,

Which ad service would you prefer to use? Most (all?) have a “test mode” which you can use to test basic ad functionality before you submit to market.

Take care,

Brent

Hello @osamasiddiqui04,

Where did you locate this code about including ads via “CoronaLibrary”? Most users simply include ads based on the documentation, as shown here:

http://docs.coronalabs.com/plugin/ads-admob-v2/index.html

Take care,

Brent

well Brent  i have written this code in scene show function in “will” phase.

Hi @osamasiddiqui04,

Please follow the documentation on this point: include the plugin in your build.settings file, then require() it in your other code by the “Syntax” we outline.

http://docs.coronalabs.com/plugin/ads-admob-v2/index.html

Take care,

Brent

Hi Brent thanks for the link i have followed all the steps from the api now i m only getting a black bar ( banner i think) but still not showing ads. i also checked admob account  there is no request on the site for any ad. i have changed the code little bit, plz check if i m missing anything. also i have commented "ads = require( “plugin.google.play.services” ) because error is occurring that “dll” doesnot exists.

thanks   

function scene: show(event)

local sceneGroup=self.view

local phase=event.phase

Runtime:addEventListener(“accelerometer”,listener)

Runtime:addEventListener( “orientation”, onOrientationChange )

if(phase == “will”) then

local Library = require “CoronaLibrary”

– Create library

local lib = Library:new{ name=‘ads’, publisherId=‘com.coronalabs’ }

ads = require( “ads” )

local function adListener( event )

if ( event.isError ) then

–Failed to receive an ad

print “Error in ads”

end

end

– ads = require( “plugin.google.play.services” )

ads.init( “admob”,“pub-6970275851831176” , adListener)

ads.show(“banner”, { x=display.contentWidth/2, y=display.contentHeight/2-200,appId=“ca-app-pub-6872334661207911/9697454180”, testMode=true})

Hi @osamasiddiqui04,

As I mentioned earlier, please follow the setup in the documentation for AdMob v2. This has been proven to work for many developers, so you should use the same model.

Take care,

Brent

hi

brent i need to know if it is really necessary that app should be on some kind of store to show ads on device 

thanks.

Hi @osamasiddiqui04,

Which ad service would you prefer to use? Most (all?) have a “test mode” which you can use to test basic ad functionality before you submit to market.

Take care,

Brent