How to get inMobi Test Banner ads?

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,

The reason you’re having trouble is because you try to initialize the plugin twice. inmobi.init() can only be called once.

The same listener is used for all ad types.

Once you receive the “init” event you can load both a banner and an interstitial ad.

Also, to answer your other question: the AdMob plugin is a paid plugin only, regardless of ad types used.

Going forward, it’s recommended that you have a look at the device log when things don’t seem to work, as the plugin will log important information there when it cannot proceed with an API call. Most of the time looking at the device log will provide enough information to solve issues like this.

Thanks for the reply.

I will try to implement what you said. And I will fetch the log file to check the necessary information.

Thanks,

Hello ingemar,

Here is the log file,

I saw the error but I am not able to understand how to fix it?

Failed to fetch ad for placement id: 1506098500582, reason phrase available in onAdLoadFailed callback

09-30 16:01:23.066&nbsp; 1131&nbsp; 1432 I ActivityManager: Start proc 17723:com.games.plugin/u0a137 for activity com.games.plugin/com.ansca.corona.CoronaActivity 09-30 16:01:23.168 17723 17723 E linker&nbsp; : readlink('') failed: No such file or directory [fd=17] 09-30 16:01:23.168 17723 17723 E linker&nbsp; : warning: unable to get realpath for the library "/data/app/com.games.plugin-1/oat/arm/base.odex". Will use given name. 09-30 16:01:23.302 17723 17723 E linker&nbsp; : readlink('') failed: No such file or directory [fd=18] 09-30 16:01:23.303 17723 17723 E linker&nbsp; : warning: unable to get realpath for the library "/data/app/com.games.plugin-1/lib/arm/liblua.so". Will use given name. 09-30 16:01:23.319 17723 17723 E linker&nbsp; : readlink('') failed: No such file or directory [fd=18] 09-30 16:01:23.320 17723 17723 E linker&nbsp; : warning: unable to get realpath for the library "/data/app/com.games.plugin-1/lib/arm/libjnlua5.1.so". Will use given name. 09-30 16:01:23.334 17723 17723 I art&nbsp;&nbsp;&nbsp;&nbsp; : Thread[1,tid=17723,Native,Thread\*=0xb850d290,peer=0x739afc48,"main"] recursive attempt to load library "/data/app/com.games.plugin-1/lib/arm/libjnlua5.1.so" 09-30 16:01:24.125 17723 17736 V Corona&nbsp; : \> Class.forName: network.LuaLoader 09-30 16:01:24.126 17723 17736 V Corona&nbsp; : \< Class.forName: network.LuaLoader 09-30 16:01:24.127 17723 17736 V Corona&nbsp; : Loading via reflection: network.LuaLoader 09-30 16:01:24.140 17723 17736 I Corona&nbsp; : Platform: Micromax Q402 / ARM Neon / 6.0 / Mali-400 MP / OpenGL ES 2.0 / 2017.3135 / English | US | en\_US | en 09-30 16:01:24.166 17723 17736 V Corona&nbsp; : \> Class.forName: shared.google.play.services.base.LuaLoader 09-30 16:01:24.167 17723 17736 V Corona&nbsp; : \< Class.forName: shared.google.play.services.base.LuaLoader 09-30 16:01:24.167 17723 17736 V Corona&nbsp; : Loading via reflection: shared.google.play.services.base.LuaLoader 09-30 16:01:24.180 17723 17736 V Corona&nbsp; : \> Class.forName: \_CoronaSetup.LuaLoader 09-30 16:01:24.242 17723 17736 V Corona&nbsp; : \> Class.forName: plugin.inMobi.LuaLoader 09-30 16:01:24.243 17723 17736 V Corona&nbsp; : \< Class.forName: plugin.inMobi.LuaLoader 09-30 16:01:24.244 17723 17736 V Corona&nbsp; : Loading via reflection: plugin.inMobi.LuaLoader 09-30 16:01:24.252&nbsp; 1131&nbsp; 1189 D WindowManager: \*\*\*\* Removing window Window{8f4a9a1 u0 Starting com.games.plugin}: count=1 Callers=com.android.server.wm.WindowManagerService.removeWindowInnerLocked:28 09 09-30 16:01:24.277 17723 17723 I Corona&nbsp; : plugin.inMobi: 1.1.6 (SDK: 7.0.0) 09-30 16:01:24.345 17723 17756 D [InMobi]: Permissions granted to SDK are : 09-30 16:01:24.345 17723 17756 D [InMobi]: android.permission.INTERNET 09-30 16:01:24.345 17723 17756 D [InMobi]: android.permission.ACCESS\_NETWORK\_STATE 09-30 16:01:24.369 17723 17736 E linker&nbsp; : readlink('/proc/self/fd/39') failed: Permission denied [fd=39] 09-30 16:01:24.370 17723 17736 E linker&nbsp; : warning: unable to get realpath for the library "/data/app/com.games.plugin-1/lib/arm/liblicensing.so". Will use given name. 09-30 16:01:24.381 17723 17736 V Corona&nbsp; : \> Class.forName: CoronaProvider.licensing.google.LuaLoader 09-30 16:01:24.382 17723 17736 V Corona&nbsp; : \< Class.forName: CoronaProvider.licensing.google.LuaLoader 09-30 16:01:24.407 17723 17736 V Corona&nbsp; : Loading via reflection: CoronaProvider.licensing.google.LuaLoader 09-30 16:01:24.412 17723 17736 I Corona&nbsp; : InMobi event: initialization successful 09-30 16:01:29.399 17723 17723 D [InMobi]: Fetching a Banner ad for placement id: 1506098500582 09-30 16:01:29.414 17723 17773 D [InMobi]: Publisher device Id is b388b54c-7ade-434f-adb4-056002318d18 09-30 16:01:30.956 17723 17723 D [InMobi]: Failed to fetch ad for placement id: 1506098500582, reason phrase available in onAdLoadFailed callback. 09-30 16:01:30.978 17723 17736 I Corona&nbsp; : InMobi event: banner ad failed to load.

Could you please have a look and let me know what steps should I take to resolve it?

Thanks,

The reason you’re having trouble is because you try to initialize the plugin twice. inmobi.init() can only be called once.

The same listener is used for all ad types.

Once you receive the “init” event you can load both a banner and an interstitial ad.

Also, to answer your other question: the AdMob plugin is a paid plugin only, regardless of ad types used.

Going forward, it’s recommended that you have a look at the device log when things don’t seem to work, as the plugin will log important information there when it cannot proceed with an API call. Most of the time looking at the device log will provide enough information to solve issues like this.

Thanks for the reply.

I will try to implement what you said. And I will fetch the log file to check the necessary information.

Thanks,

Hello ingemar,

Here is the log file,

I saw the error but I am not able to understand how to fix it?

Failed to fetch ad for placement id: 1506098500582, reason phrase available in onAdLoadFailed callback

09-30 16:01:23.066&nbsp; 1131&nbsp; 1432 I ActivityManager: Start proc 17723:com.games.plugin/u0a137 for activity com.games.plugin/com.ansca.corona.CoronaActivity 09-30 16:01:23.168 17723 17723 E linker&nbsp; : readlink('') failed: No such file or directory [fd=17] 09-30 16:01:23.168 17723 17723 E linker&nbsp; : warning: unable to get realpath for the library "/data/app/com.games.plugin-1/oat/arm/base.odex". Will use given name. 09-30 16:01:23.302 17723 17723 E linker&nbsp; : readlink('') failed: No such file or directory [fd=18] 09-30 16:01:23.303 17723 17723 E linker&nbsp; : warning: unable to get realpath for the library "/data/app/com.games.plugin-1/lib/arm/liblua.so". Will use given name. 09-30 16:01:23.319 17723 17723 E linker&nbsp; : readlink('') failed: No such file or directory [fd=18] 09-30 16:01:23.320 17723 17723 E linker&nbsp; : warning: unable to get realpath for the library "/data/app/com.games.plugin-1/lib/arm/libjnlua5.1.so". Will use given name. 09-30 16:01:23.334 17723 17723 I art&nbsp;&nbsp;&nbsp;&nbsp; : Thread[1,tid=17723,Native,Thread\*=0xb850d290,peer=0x739afc48,"main"] recursive attempt to load library "/data/app/com.games.plugin-1/lib/arm/libjnlua5.1.so" 09-30 16:01:24.125 17723 17736 V Corona&nbsp; : \> Class.forName: network.LuaLoader 09-30 16:01:24.126 17723 17736 V Corona&nbsp; : \< Class.forName: network.LuaLoader 09-30 16:01:24.127 17723 17736 V Corona&nbsp; : Loading via reflection: network.LuaLoader 09-30 16:01:24.140 17723 17736 I Corona&nbsp; : Platform: Micromax Q402 / ARM Neon / 6.0 / Mali-400 MP / OpenGL ES 2.0 / 2017.3135 / English | US | en\_US | en 09-30 16:01:24.166 17723 17736 V Corona&nbsp; : \> Class.forName: shared.google.play.services.base.LuaLoader 09-30 16:01:24.167 17723 17736 V Corona&nbsp; : \< Class.forName: shared.google.play.services.base.LuaLoader 09-30 16:01:24.167 17723 17736 V Corona&nbsp; : Loading via reflection: shared.google.play.services.base.LuaLoader 09-30 16:01:24.180 17723 17736 V Corona&nbsp; : \> Class.forName: \_CoronaSetup.LuaLoader 09-30 16:01:24.242 17723 17736 V Corona&nbsp; : \> Class.forName: plugin.inMobi.LuaLoader 09-30 16:01:24.243 17723 17736 V Corona&nbsp; : \< Class.forName: plugin.inMobi.LuaLoader 09-30 16:01:24.244 17723 17736 V Corona&nbsp; : Loading via reflection: plugin.inMobi.LuaLoader 09-30 16:01:24.252&nbsp; 1131&nbsp; 1189 D WindowManager: \*\*\*\* Removing window Window{8f4a9a1 u0 Starting com.games.plugin}: count=1 Callers=com.android.server.wm.WindowManagerService.removeWindowInnerLocked:28 09 09-30 16:01:24.277 17723 17723 I Corona&nbsp; : plugin.inMobi: 1.1.6 (SDK: 7.0.0) 09-30 16:01:24.345 17723 17756 D [InMobi]: Permissions granted to SDK are : 09-30 16:01:24.345 17723 17756 D [InMobi]: android.permission.INTERNET 09-30 16:01:24.345 17723 17756 D [InMobi]: android.permission.ACCESS\_NETWORK\_STATE 09-30 16:01:24.369 17723 17736 E linker&nbsp; : readlink('/proc/self/fd/39') failed: Permission denied [fd=39] 09-30 16:01:24.370 17723 17736 E linker&nbsp; : warning: unable to get realpath for the library "/data/app/com.games.plugin-1/lib/arm/liblicensing.so". Will use given name. 09-30 16:01:24.381 17723 17736 V Corona&nbsp; : \> Class.forName: CoronaProvider.licensing.google.LuaLoader 09-30 16:01:24.382 17723 17736 V Corona&nbsp; : \< Class.forName: CoronaProvider.licensing.google.LuaLoader 09-30 16:01:24.407 17723 17736 V Corona&nbsp; : Loading via reflection: CoronaProvider.licensing.google.LuaLoader 09-30 16:01:24.412 17723 17736 I Corona&nbsp; : InMobi event: initialization successful 09-30 16:01:29.399 17723 17723 D [InMobi]: Fetching a Banner ad for placement id: 1506098500582 09-30 16:01:29.414 17723 17773 D [InMobi]: Publisher device Id is b388b54c-7ade-434f-adb4-056002318d18 09-30 16:01:30.956 17723 17723 D [InMobi]: Failed to fetch ad for placement id: 1506098500582, reason phrase available in onAdLoadFailed callback. 09-30 16:01:30.978 17723 17736 I Corona&nbsp; : InMobi event: banner ad failed to load.

Could you please have a look and let me know what steps should I take to resolve it?

Thanks,