Hello everyone,
Firstly I would like to know is adMob a paid plugin? And what if I have to use banner and interstitial ads only? Do I still have to purchase the plugin?
Actually my question is I integrated inMobi ad network in one of my games. I get interstitial test ads from inmobi for testing purpose, but when I try to fetch banner test ads it never shows anything.
Here is my code
inMobiAds.lua
local inMobi = require( "plugin.inMobi" ) local accID = "MY Account ID" local placementBannerID = "my banner id" local placementInterstitialID = "my interstitial id" local function adBannerListener( event ) if ( event.phase == "init" ) then inMobi.load( "banner", placementBannerID ) elseif ( event.phase == "failed" ) then print( "Ad Failed" ) end end local function adInterstitialListener( event ) if ( event.phase == "init" ) then inMobi.load( "interstitial", placementInterstitialID ) elseif ( event.phase == "failed" ) then print("Ad Failed" ) end end function adsInitialize() inMobi.init( adInterstitialListener, { accountId=accID } ) inMobi.init( adBannerListener, { accountId=accID } ) end function showInterstitialAds() inMobi.show( placementInterstitialID, { yAlign="top" } ) end function showBannerAds() inMobi.show( placementBannerID, { yAlign="top" } ) end
main.lua
require "inMobiAds" function myMain() adsInitialize() showBannerAds() end myMain()
So if I call showInterstitialAds function it works fine and it also display the test ads. But with showBannerAds function it never shows anything. Even it’s being initialized properly but still I don’t get the test ads.
I have attached screenshot of my app in inmobi account.
Any help would be highly appreciated.
Thanks,