admob appinit app id

I tested in the device android

I have this log ,

No app id was supplied to ads.init .Using test app id() instead for ad network admob

I see this tutorial

http://coronalabs.com/blog/2014/07/15/tutorial-implementing-admob-v2/

[lua]

local ads = require( “ads” )

local bannerAppID = “ca-app-pub-nnnnnnnnnnn/nnnnnnnnn”  --for your iOS banner

local interstitialAppID = “ca-app-pub-nnnnnnnnnnn/nnnnnnnn”  --for your iOS interstitial

if ( system.getInfo( “platformName” ) == “Android” ) then

    bannerAppID = “ca-app-pub-nnnnnnnnnnn/nnnnnnnnn”  --for your Android banner I place my admobID

    interstitalAppID = “ca-app-pub-nnnnnnnnnnn/nnnnnnnnn”  --for your Android interstitial–I place my admobId

end

local adProvider = “admob”

local function adListener( event )

    --(more on this later)

– The ‘event’ table includes:

    – event.name: string value of “adsRequest”

    – event.response: message from the ad provider about the status of this request

    – event.phase: string value of “loaded”, “shown”, or “refresh”

    – event.type: string value of “banner” or “interstitial”

    – event.isError: boolean true or false

    local msg = event.response

    – Quick debug message regarding the response from the library

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

    if ( event.isError ) then

        print( “Error, no ad received”, msg )

    else

        print( “Ah ha! Got one!” )

    end

end

ads.init( adProvider, appID, adListener )

if ( ads.isLoaded(“interstitial”) ) then

    ads.show(“interstitial”)

end

testMode=true

ads.show( “interstitial”, { appID=interstitialAppID,testMode = true } )

[/lua]

Did you use this code:
 

local bannerAppID = "ca-app-pub-nnnnnnnnnnn/nnnnnnnnn"  --for your iOS banner local interstitialAppID = "ca-app-pub-nnnnnnnnnnn/nnnnnnnn"  --for your iOS interstitial if ( system.getInfo( "platformName" ) == "Android" ) then     bannerAppID = "ca-app-pub-nnnnnnnnnnn/nnnnnnnnn"  --for your Android banner I place my admobID     interstitalAppID = "ca-app-pub-nnnnnnnnnnn/nnnnnnnnn"  --for your Android interstitial--I place my admobId end

exactly or did you replace the values “ca-app-pub-nnnnnnnnnnn/nnnnnnnnn” with the values created in the Google AdMob portal?   You can’t use the nnnnnnnn/nnnnnnn stuff.  Google gives you unique values for  your app. 

Rob

I replaced the values in android.

I cannot find the appID in the example.

I dont find any appID in admob.

I just have “ad unit for banner and interstitial”.

The Ad Unit ID is the value you provide for the Ad ID.  We have to keep the documentation generic for ads.init() because most vendors call it Ad ID.  Google uses a different name.   Just put your Ad Unit ID in where we have AppID or the generic “ca-app-pub-nnnnnnnnnnn/nnnnnnnnn” listed.

Rob

I put this, It works

what about adListener, I dont place that .

Is it important to place adListener?

[lua]

local ads = require “ads”

local provider = “admob”

local BannerAppID = “my banner unit” --Banner

ads.init( “admob”, BannerAppID, adListener)

ads.show( “banner”, { appID= BannerAppID,x=0,y=0} )

[/lua]

The adListener is a function that gets called when a banner ad is loaded.  Because the ad services don’t always return ads, you can look for errors from them and call another ad service to make sure you always get an ad.  Also if you have troubles showing ads, you can usually determine what is going on.

For banners, it’s not all that important. 

Did you use this code:
 

local bannerAppID = "ca-app-pub-nnnnnnnnnnn/nnnnnnnnn"  --for your iOS banner local interstitialAppID = "ca-app-pub-nnnnnnnnnnn/nnnnnnnn"  --for your iOS interstitial if ( system.getInfo( "platformName" ) == "Android" ) then     bannerAppID = "ca-app-pub-nnnnnnnnnnn/nnnnnnnnn"  --for your Android banner I place my admobID     interstitalAppID = "ca-app-pub-nnnnnnnnnnn/nnnnnnnnn"  --for your Android interstitial--I place my admobId end

exactly or did you replace the values “ca-app-pub-nnnnnnnnnnn/nnnnnnnnn” with the values created in the Google AdMob portal?   You can’t use the nnnnnnnn/nnnnnnn stuff.  Google gives you unique values for  your app. 

Rob

I replaced the values in android.

I cannot find the appID in the example.

I dont find any appID in admob.

I just have “ad unit for banner and interstitial”.

The Ad Unit ID is the value you provide for the Ad ID.  We have to keep the documentation generic for ads.init() because most vendors call it Ad ID.  Google uses a different name.   Just put your Ad Unit ID in where we have AppID or the generic “ca-app-pub-nnnnnnnnnnn/nnnnnnnnn” listed.

Rob

I put this, It works

what about adListener, I dont place that .

Is it important to place adListener?

[lua]

local ads = require “ads”

local provider = “admob”

local BannerAppID = “my banner unit” --Banner

ads.init( “admob”, BannerAppID, adListener)

ads.show( “banner”, { appID= BannerAppID,x=0,y=0} )

[/lua]

The adListener is a function that gets called when a banner ad is loaded.  Because the ad services don’t always return ads, you can look for errors from them and call another ad service to make sure you always get an ad.  Also if you have troubles showing ads, you can usually determine what is going on.

For banners, it’s not all that important.