So I’ve been trying to implement in mobi over the last day or two but I just cant get it working. The code is simple:
build.settings important bits:
-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", "portraitUpsideDown" } }, android = { versionCode = "10", largeHeap = true, usesPermissions = { "com.android.vending.BILLING", "android.permission.INTERNET", "android.permission.READ\_PHONE\_STATE", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.ACCESS\_ASSISTED\_GPS", "android.permission.ACCESS\_COARSE\_LOCATION", "android.permission.ACCESS\_FINE\_LOCATION", "android.permission.ACCESS\_GPS", "android.permission.ACCESS\_LOCATION", "android.permission.ACCESS\_WIFI\_STATE", "android.permission.CALL\_PHONE", "android.permission.CHANGE\_WIFI\_STATE", "android.permission.MODIFY\_AUDIO\_SETTINGS", "android.permission.READ\_LOGS", "android.permission.RECORD\_AUDIO", "android.permission.VIBRATE", "android.permission.WRITE\_EXTERNAL\_STORAGE", }, supportsScreens = { resizeable = false, smallScreens = true, normalScreens = true, largeScreens = true, xlargeScreens = true, }, }, plugins = { ["plugin.inmobi"] = { publisherId = "com.inmobi", }, }, }
main.lua important bits:
--InMobi local Inmobi = require "plugin.inmobi" local appID = "b2e43e0xxxxxxxxxx" if system.getInfo( "platformName" ) == "Android" then appID = "b2bd26764xxxxxxxxxxx" end if system.getInfo( "environment" ) ~= "simulator" then Inmobi.initWithParams(appID, function(event) for k,v in pairs(event) do print("InMobi", k, v) end end, { logLevel=Inmobi.CONSTANTS.LOGLEVEL\_VERBOSE }) local interstitialAd = Inmobi.createInterstitialAd() interstitialAd.load() interstitialAd.show() end
So iOS returns this:
<Warning>: InMobi message Error Domain=InMobi Code=0 “Invalid request. This could be due to an invalid InMobi app-id, or the app-id might not be in the Active state.” UserInfo=0x1b8e53a0 {NSLocalizedDescription=Invalid request. This could be due to an invalid InMobi app-id, or the app-id might not be in the Active state.}
Android, crashes as soon as I call interstitialAd.show() with:
12-15 21:22:29.513: I/Corona(27434): java.lang.NullPointerException
12-15 21:22:29.513: I/Corona(27434): Java Stack Trace:
12-15 21:22:29.513: I/Corona(27434): plugin.inmobi.LuaLoader$InterstitialAdWrapper.show(LuaLoader.java:833)
12-15 21:22:29.513: I/Corona(27434): plugin.inmobi.LuaLoader$createInterstitialAdWrapper$1.invoke(LuaLoader.java:646)
12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.JavaToNativeShim.nativeResize(Native Method)
12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.JavaToNativeShim.resize(JavaToNativeShim.java:372)
12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onSurfaceChanged(CoronaGLSurfaceView.java:374)
12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1611)
12-15 21:22:29.513: I/Corona(27434): com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377)
12-15 21:22:29.513: I/Corona(27434): stack traceback:
12-15 21:22:29.513: I/Corona(27434): [C]: in function ‘show’
12-15 21:22:29.513: I/Corona(27434): ?: in main chunk
On the website:
Added the properties for ios and Android, pasted the store links (THE APP IS NOT LIVE YET ON EITHER PLATFORM) (they still say pending approval), enabled test mode, copied in my iPhone ID returned from the init function call into test devices.
Any ideas anyone?
I think the iOS one is missing something on the web side but not sure why Android is crashing.