Hey Guys,
My game is crashing when I try to test it on device.
I think it is related to my implementation of the AdMob code in build settings and main.lua because
in the time before the MONETAZIATION all thing went well.
I receive the warning message
admob.init() WARNING: The AdMob plugin is only supported on Android & iOS devices. Please build for device
This is my code:
build.settings;
settings =
{
orientation =
{
default =“portrait”,
supported = {“portrait”},
},
plugins =
{
[“plugin.admob”] =
{
publisherId = “com.coronalabs”,
},
},
android =
{
midSdkVersion = "16",
applicationChildElements =
{
[[
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="***********************************"/>
]],
},
},
{
versionCode = "14",
},
}
main.lua;
local admob = require( “plugin.admob” )
– AdMob listener function
local function adListener( event )
if ( event.phase == "init" ) then -- Successful initialization
-- Load an AdMob interstitial ad
admob.load( "interstitial", { adUnitId="ca-app-pub-3625432895557434/6931049632" } )
end
if ( admob.isLoaded( "interstitial" ) ) then
admob.show( "interstitial" )
end
end
– Initialize the AdMob plugin
admob.init( adListener, { appId=“pub-3625432895557434”, testMode = true } )
It would be nice if you help me.
thank you