Using Multiple Ad Networks?

Hi,

I’m trying to use both Vungle and inMobi in my app. When doing ads.init, do we just call it twice (once for each provider)? Also, what about ads.show (there’s no way to specify which provider we’d like to use)? 

I’d like to know how you’re all handling multiple ad networks. Thanks!

@naveen_pcs, I’m not doing inmobi, but I init more than one adnetwork (such as vungle, iads, admob, etc.) by init’ing one after the other.  When I show an ad, I call ads:setCurrentProvider API.  See below.

Naomi

[lua]

local ads = require( “ads” )

local adNetwork

local appID

local adListener

appID = “vungleapidhere”

ads.init( “vungle”, appID, adListener )

appID = “iadsappidhere”

ads.init( “iads”, appID, adListener )

appID = “admobappidhere”

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

adNetwork = “vungle”  – This will display vungle ad.  Change it to “iads”, “admob”, etc. as needed

ads:setCurrentProvider(adNetwork)

– then call ads.show API

[/lua]

@Naomi Thanks. I didn’t see this mentioned anywhere in the documentation. I’ll give it a try.

@Naomi Worked perfectly. Thanks!

@naveen_pcs, I’m glad I could help.  I know it’s frustrating not to find any documentation for things like this.  I only know this through a forum post that was responded by one of the Corona staff a while back.

Naomi

@naveen_pcs, I’m not doing inmobi, but I init more than one adnetwork (such as vungle, iads, admob, etc.) by init’ing one after the other.  When I show an ad, I call ads:setCurrentProvider API.  See below.

Naomi

[lua]

local ads = require( “ads” )

local adNetwork

local appID

local adListener

appID = “vungleapidhere”

ads.init( “vungle”, appID, adListener )

appID = “iadsappidhere”

ads.init( “iads”, appID, adListener )

appID = “admobappidhere”

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

adNetwork = “vungle”  – This will display vungle ad.  Change it to “iads”, “admob”, etc. as needed

ads:setCurrentProvider(adNetwork)

– then call ads.show API

[/lua]

@Naomi Thanks. I didn’t see this mentioned anywhere in the documentation. I’ll give it a try.

@Naomi Worked perfectly. Thanks!

@naveen_pcs, I’m glad I could help.  I know it’s frustrating not to find any documentation for things like this.  I only know this through a forum post that was responded by one of the Corona staff a while back.

Naomi

Sorry to resurrect an old topic!
Does this mean you can have more than 1 advert per page?

Sorry to resurrect an old topic!
Does this mean you can have more than 1 advert per page?