Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

ADMOB, integrate both banner and interstitual issue
Started by bubblebobble Aug 01 2013 07:41 AM

88 replies to this topic
[TOPIC CONTROLS]
Page 1 of 4 1 2 3 »
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

bubblebobble

[GLOBAL: userInfoPane.html]
bubblebobble
  • Contributor

  • 309 posts
  • Corona SDK

Hi,

I can get either banners or interstituals working only.

 

I have a game, a banner ad is called at the start no problem, I then hide it when the user clicks to play again on the game over screen.

I then call an interstitual ad for the screen before the game replays.

 

Now I can get either the banner or the interstitual working but not both/???

Can I only call init once? I dont think so.

 

ANy comments would be cool



[TOPIC: post.html]
#2

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi @bubblebobble,

Initialization is done just once, and then "show" is used to display either banner or interstitial. Is this how you've set it up? And, by the way, which device(s) are you testing on?

 

Brent



[TOPIC: post.html]
#3

bubblebobble

[GLOBAL: userInfoPane.html]
bubblebobble
  • Contributor

  • 309 posts
  • Corona SDK

hi Brent,

 

yes it is set up as in the docs, problem occurs when trying to use 2 different ads.

Devices are, nexus 7, htc one x, samsung galaxy s3, htc sensation.

I have no issues displaying either type but both is a no no.

I know I should only init once but it inits the appID for a banner or an interstitial.

 

Example:

 

initialize admob

I have a banner ad setup with an  appID

I have an interstitial setup with an appID2

  local provider = "admob"
  local appID = "appID"
  local appID2 = "appID2"
  ads.init( provider, appID, adListener )
  ads.init( provider, appID2, adListener )
 

  local adX = 0
  local adY = 0
  ads.show( "interstitial", { x=adX, y=adY } )
  ads.show("banner", { x=adX, y=adY })

the hide it

ads.hide("banner") .....unsure if this can be done but works ok

 

ads.show("interstitial")

 

ads.hide("banner")

 

etc etc

 

Seems I can only call one appID at a time when I init the session.



[TOPIC: post.html]
#4

mark.biggiero

[GLOBAL: userInfoPane.html]
mark.biggiero
  • Enthusiast

  • 32 posts
  • Corona SDK

hi Brent,

 

yes it is set up as in the docs, problem occurs when trying to use 2 different ads.

Devices are, nexus 7, htc one x, samsung galaxy s3, htc sensation.

I have no issues displaying either type but both is a no no.

I know I should only init once but it inits the appID for a banner or an interstitial.

 

Example:

 

initialize admob

I have a banner ad setup with an  appID

I have an interstitial setup with an appID2

  local provider = "admob"
  local appID = "appID"
  local appID2 = "appID2"
  ads.init( provider, appID, adListener )
  ads.init( provider, appID2, adListener )
 

  local adX = 0
  local adY = 0
  ads.show( "interstitial", { x=adX, y=adY } )
  ads.show("banner", { x=adX, y=adY })

the hide it

ads.hide("banner") .....unsure if this can be done but works ok

 

ads.show("interstitial")

 

ads.hide("banner")

 

etc etc

 

Seems I can only call one appID at a time when I init the session.

 

Have you solved this? Because i have the same issue.



[TOPIC: post.html]
#5

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,569 posts
  • Corona Staff

Is there a reason you need two AppID's?  Can't one deliver both banners and interstitials?  (remember I've never use adMob before...)



[TOPIC: post.html]
#6

mark.biggiero

[GLOBAL: userInfoPane.html]
mark.biggiero
  • Enthusiast

  • 32 posts
  • Corona SDK

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?



[TOPIC: post.html]
#7

bubblebobble

[GLOBAL: userInfoPane.html]
bubblebobble
  • Contributor

  • 309 posts
  • Corona SDK

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.



[TOPIC: post.html]
#8

mark.biggiero

[GLOBAL: userInfoPane.html]
mark.biggiero
  • Enthusiast

  • 32 posts
  • Corona SDK

well, then i'll try the admob + playhaven combo



[TOPIC: post.html]
#9

mark.biggiero

[GLOBAL: userInfoPane.html]
mark.biggiero
  • Enthusiast

  • 32 posts
  • Corona SDK

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



[TOPIC: post.html]
#10

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,440 posts
  • Corona SDK

I'm curious if you could flush the admob module and hit the init again.

 

This is a function I use to "unrequire" modules:

 

--- 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

 

I have not tested this myself, but I'm guessing you'd do something like so...

 

 

SceneN

 

 

local ads = require( "ads" )
 
--< Show AD and later on...
 
unrequire( "ads" )

 

 

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.

 

 



[TOPIC: post.html]
#11

mark.biggiero

[GLOBAL: userInfoPane.html]
mark.biggiero
  • Enthusiast

  • 32 posts
  • Corona SDK

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



[TOPIC: post.html]
#12

lano78

[GLOBAL: userInfoPane.html]
lano78
  • Contributor

  • 370 posts
  • Corona SDK

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 )

 

 
 

 

 

 

 



[TOPIC: post.html]
#13

Russpuppy

[GLOBAL: userInfoPane.html]
Russpuppy
  • Observer

  • 16 posts
  • Corona SDK

tried pretty much all the suggestions in this thread, nothing working yet



[TOPIC: post.html]
#14

bubblebobble

[GLOBAL: userInfoPane.html]
bubblebobble
  • Contributor

  • 309 posts
  • Corona SDK

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.



[TOPIC: post.html]
#15

mark.biggiero

[GLOBAL: userInfoPane.html]
mark.biggiero
  • Enthusiast

  • 32 posts
  • Corona SDK

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



[TOPIC: post.html]
#16

Russpuppy

[GLOBAL: userInfoPane.html]
Russpuppy
  • Observer

  • 16 posts
  • Corona SDK

Brent, is Corona built to support only 1 type of ad per app session?

 

Hi @bubblebobble,

Initialization is done just once, and then "show" is used to display either banner or interstitial. Is this how you've set it up? And, by the way, which device(s) are you testing on?

 

Brent



[TOPIC: post.html]
#17

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,569 posts
  • Corona Staff

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?



[TOPIC: post.html]
#18

ubj3d.android

[GLOBAL: userInfoPane.html]
ubj3d.android
  • Contributor

  • 741 posts
  • Corona SDK

Anyone managed to get banner and interstitials work together?



[TOPIC: post.html]
#19

hayk

[GLOBAL: userInfoPane.html]
hayk
  • Enthusiast

  • 51 posts
  • Corona SDK

Hello, 

Is there a solution for this problem already?



[TOPIC: post.html]
#20

ubj3d.android

[GLOBAL: userInfoPane.html]
ubj3d.android
  • Contributor

  • 741 posts
  • Corona SDK

[TOPIC: post.html]
#21

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

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



[TOPIC: post.html]
#22

ubj3d.android

[GLOBAL: userInfoPane.html]
ubj3d.android
  • Contributor

  • 741 posts
  • Corona SDK

Great news, thank you.



[TOPIC: post.html]
#23

hayk

[GLOBAL: userInfoPane.html]
hayk
  • Enthusiast

  • 51 posts
  • Corona SDK

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

 

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?



[TOPIC: post.html]
#24

ubj3d.android

[GLOBAL: userInfoPane.html]
ubj3d.android
  • Contributor

  • 741 posts
  • Corona SDK

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.



[TOPIC: post.html]
#25

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi all,

We just updated the AdMob plugin. The ads.show() function now accepts a new value for the "params" table: "appId". You can read more about it in the documentation:

 

http://docs.coronalabs.com/daily/plugin/ads-admob/show.html

 

This should be effective immediately (no need to wait for a daily build rollout). Please test it out and report if you have any unexpected issues with it.

 

Thanks,

Brent




[topic_controls]
Page 1 of 4 1 2 3 »
 
[/topic_controls]