Sorry, but I need help!
I made correct setup in Appodeal and ADmob webside.
I inserted the code on my app: at the beginning was working. Now I don’t understand but the banner or wathever type of advertisign doesn’t appears.
I tryed to insert in the first line of main.lua but nothing changed.
If I try the demo appodeal it works!
This think made me crazy.
So my code:
build.settings
settings =
{
orientation =
{
default = "landscapeLeft",
supported = { "landscapeLeft, landscapeRight" }
},
iphone =
{
xcassets = "Images.xcassets",
plist =
{
UILaunchStoryboardName = "LaunchScreen",
ITSAppUsesNonExemptEncryption = false, -- This sample doesn't use custom encryption
CFBundleLocalizations =
{
"English",
"French",
"Italian",
},
},
},
window =
{
titleText =
{
default = "Pong",
},
},
android =
{
usesPermissions =
{
"android.permission.INTERNET",
"android.permission.ACCESS_NETWORK_STATE",
"android.permission.WRITE_EXTERNAL_STORAGE",
"android.permission.GET_ACCOUNTS",
"android.permission.ACCESS_COARSE_LOCATION",
"android.permission.ACCESS_FINE_LOCATION",
},
applicationChildElements =
{
[[
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-8932051454535909~33676945xx/>
]]
},
},
plugins =
{
-- Base
['plugin.appodeal.beta.base'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.AdColony'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.AppLovin'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.InMobi'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.Tapjoy'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.Unity'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.Vungle'] = { publisherId = 'com.coronalabs' },
},
}
intro.lua
local composer = require( "composer" )
----------------------------------------------------------------------
----------------------------------------------------------------------
-- APPODEAL
----------------------------------------------------------------------
----------------------------------------------------------------------
local appodeal = require( "plugin.appodeal" )
local appodealParams = {
appKey = "fc3d67ae850a01b2a9314a74ed7988a7f3cd10d7a7f87axx",
testMode = false,
supportedAdTypes = { "banner","interstitial" },
hasUserConsent = true,
}
local function adListener( event )
-- Successful initialization of the Appodeal plugin
if ( event.phase == "init" ) then
print( "Appodeal event: initialization successful" )
appodeal.show( "banner" )
-- An ad loaded successfully
elseif ( event.phase == "loaded" ) then
print( "Appodeal event: " .. tostring(event.type) .. " ad loaded successfully" )
-- The ad was displayed/played
elseif ( event.phase == "displayed" or event.phase == "playbackBegan" ) then
print( "Appodeal event: " .. tostring(event.type) .. " ad displayed" )
-- The ad was closed/hidden/completed
elseif ( event.phase == "hidden" or event.phase == "closed" or event.phase == "playbackEnded" ) then
print( "Appodeal event: " .. tostring(event.type) .. " ad closed/hidden/completed" )
-- The user clicked/tapped an ad
elseif ( event.phase == "clicked" ) then
print( "Appodeal event: " .. tostring(event.type) .. " ad clicked/tapped" )
-- The ad failed to load
elseif ( event.phase == "failed" ) then
print( "Appodeal event: " .. tostring(event.type) .. " ad failed to load" )
--native.showAlert("Appodeal", "FAILED_APPODEAL" .. " isError: " .. event.isError .. " response:" .. event.response, {"OK_APPODEAL"})
end
end
-- show()
function scene:show( event )
local sceneGroup = self.view
if (event.phase == "will" ) then
-- Code here runs when the scene is still off screen (but is about to come on screen)
elseif ( event.phase == "did" ) then
-- Init the Appodeal plugin
appodeal.init( adListener, appodealParams )
-- Code here runs when the scene is entirely on screen
local introImg = display.newImageRect(sceneGroup, "Immagini/intro.png", schermo.fullWidth, schermo.fullHeight)
introImg.x = display.contentCenterX
introImg.y = display.contentCenterY
--timer.performWithDelay( 3000, function() composer.gotoScene( "welcome", { time=600, effect="crossFade" } ) end)
end
end
the banner doesn’t appears.
I don’t know how to receive a log from phone to understand where is the problem.
Again at the beginning the banner was working. But now i still receive a black screen without crash or hang the program.
Thanks for help.
Renato