Is there a reason you need two AppID’s? Can’t one deliver both banners and interstitials? (remember I’ve never use adMob before…)
no. when you create an ad in admob you can choose whatever it’s a banner or an interstitial. i made both, and i have 2 app ids. do you know any workaround? i’d like to implement it as soon as possible, since my ecpm on chartboost is like 0.5$.
i already trade initializing both at the beginnig, initializing interstitial right before showing it, making another require ads variable. the result is that it shows me only the first one i initialize.
EDIT: can i at least “deinitialize” it?
I never did find out how to do this or even if its possible.
I messed with it for a good time and gave up, ended up using Admob and revmob togethor, not perfect but at least I could have both banner and fullscreen.
As for de initializing it, I dont think so, I couldnt find anything in api that would do this.
well, then i’ll try the admob + playhaven combo
is there any fix coming at least? because i really need to implement them both. all other networks have very low ecpm, i got lik 20k impressions with 0.5$ ecpm daily, so its kinda a waste
I’m curious if you could flush the admob module and hit the init again.
This is a function I use to “unrequire” modules:
[lua]
— Removes references to a module.
– @param m Name of the module you want removed.
local function unrequire( m )
package.loaded[m] = nil
_G[m] = nil
return true
end
[/lua]
I have not tested this myself, but I’m guessing you’d do something like so…
SceneN
[lua]
local ads = require( “ads” )
–< Show AD and later on…
unrequire( “ads” )
[/lua]
You’d probably want to unrequire it in your exit scene. If I have time to test it later I will, but see if that works.
Cheers.
nope, it doesn’t work. as you said, im unloading the module on exitscene. the app only displays that first type of ads i initialized. i can switch em, but no way of making them work together
I’ve just been playing around with the new corona release and started tinkering with ads and plugins. This is a simple solution I came up with for using multiple adNetworks at once. I guess it could be extended into something like the "GGLib"´s or adMediator.
I even tried having my adData on a remote server and remotely change adNetworks and it worked fine.
-- main.lua local ads = require("ads") local adData = { adsActivated = true, scenes = { menuScene = "admob", gameScene = "iads", settingsScene = "inneractive" }, networks = { ["admob"] = "123456789", ["inneractive"] = "123456789", ["iads"] = "com.company.appname" } } function adListener(event) local msg = event.response if event.isError then print("Ad error : "..msg) end end local function initAds() for k, v in pairs(adData.networks) do ads.init(k, v, adListener) end end function showBanner(params) local banner = nil local provider = params.provider local xPos, yPos = params.x, params.y if provider == "admob" then ads:setCurrentProvider(provider) banner = ads:show("banner", { x = xPos, y = yPos }) elseif provider == "inneractive" then ads:setCurrentProvider(provider) banner = ads:show("banner", { x = xPos, y = yPos }) elseif provider == "iads" then ads:setCurrentProvider(provider) banner = ads:show("banner", { x = xPos, y = yPos }) end return banner end if adData.adsActivated == true then initAds() end
---------------------------------------------- -- someScene.lua -- Then you, if using storyboard.. local storyboard = require( "storyboard" ) local scene = storyboard.newScene() local ads = require("ads") --[[.. whatever code... --]] function scene:enterScene(event) local group = self.view showBanner(adData.scenes.menuScene) end function scene:exitScene( event ) local group = self.view ads.hide() end scene:addEventListener( "enterScene", scene ) scene:addEventListener( "exitScene", scene )
tried pretty much all the suggestions in this thread, nothing working yet
I started this thread a while back, I actually think its an Admob issue rather than Corona specific.
Perhaps Admob only allows the device to register one ID to the app while its running.
I am sure it logs the device ID and associates it with one ID while the app is active.
However couldnt you just kill the socket and re init admob?
I dont know, thats why I gave up and reverted to 2 separate ad networks for both.
I would think it best to look at native Java and see if it can be done there, if it can then we have something to work with if not then we dont.
Just my thoughts.
it can’t be admob issue. doing this in eclipse, everything works fine. also, why would they make different ids for different ad types if there dont support them? this is coronas issue, the ads library to be precise
Anyone managed to get banner and interstitials work together?
Brent, is Corona built to support only 1 type of ad per app session?
Corona SDK itself doesn’t enforce rules on what ad types can be shown. All of the providers take parameters as to what can be shown and they have their own inventory to pull from. Their code draws the ad and manages it. We really are just a pass through to them.
What seems to be the problem with AdMob is that you have to have different AppID’s for the different Ad Types and Our system is really setup to only enable one AppID per vendor. You only need one for all the other ad providers like iAds, Inneractive, inMobi, etc. Now Inneractive and such use multiple AppID’s but its on a device by device basic, not on an ad type by ad type. That is the AppID for an Apple device is different than for an Android device, so you can detect what platform you are on and send the right ID.
Would you be willing to file a bug report on this with a small sample app that demo’s the issues?
Hello,
Is there a solution for this problem already?
No.
Hi guys,
We are discussing this at the moment (this week). I just don’t know what the resolution is going to be yet. Your patience is definitely appreciated.
Thanks,
Brent
Great news, thank you.
Hi, can you just make a duplicate plugin with name admob1 as a workaround while you think of permanent solution?
We could use 2 plugins and just switch ad provider when needed?
Please consider returning a value in the error which would be used to determine if the error is from banner or interstitial.
Now there is no way to have that info.