Hey,
I use fullscreen admob and charboost ads on the game-over screen, both work fine.
I usually give them some time to load. When both are loaded, chartboost is displayed with a probability of 75%.
The ad details in the code are the test details used in the examples that come with AGK.
As soon as the game starts, I preload the ads with:
if GetDeviceBaseName() = "android"
SetChartboostDetails( "54c6658f43150f144c4aa085", "a7938066bd8cadc2b0fbc711f3baa90c9743b5b0" ) // Android interstitial
SetAdMobDetails( "ca-app-pub-6042722625366627/9628992965" ) // Android interstitial
endif
@ GAME OVER, I call this function to show them:
// SHOWS ADS AFTER GAME OVER
function ShowAds()
local foo as float
local r as integer
foo = timer()
if GetDeviceBaseName() = "android"
if ( GetFullscreenAdvertLoadedChartboost() = 0 ) and ( GetFullscreenAdvertLoadedChartboost() = 0 ) // no ad loaded at game start? Request again !
SetChartboostDetails( "54c6658f43150f144c4aa085", "a7938066bd8cadc2b0fbc711f3baa90c9743b5b0" ) // Android interstitial
SetAdMobDetails( "ca-app-pub-6042722625366627/9628992965" ) // Android interstitial
RequestAdvertRefresh()
endif
endif
// give ads some time to load
repeat
sync()
until ( timer() - foo > 4.0 ) or ( GetFullscreenAdvertLoadedChartboost() = 1 ) // prefer Chartboost
if GetFullscreenAdvertLoadedChartboost() = 1 and GetFullscreenAdvertLoadedAdMob() = 0 // only chartboost was loaded
ShowFullscreenAdvertChartboost()
exitfunction
endif
if GetFullscreenAdvertLoadedAdMob() = 1 and GetFullscreenAdvertLoadedChartboost() = 0 // only admob was loaded
ShowFullscreenAdvertAdMob()
exitfunction
endif
if GetFullscreenAdvertLoadedAdMob() = 1 and GetFullscreenAdvertLoadedChartboost() = 1 // chartboost AND admob were loaded, so throw a dice ( prefer chartboost with a probability of 75% )
r = random ( 1, 4 )
if r > 1 then ShowFullscreenAdvertChartboost() else ShowFullscreenAdvertAdMob()
exitfunction
endif
RequestAdvertRefresh() // no ad has been shown, request reload
endfunction