Hi all, not sure why this is happening to me but for unknown reasons:
- when I use same code below on android and I launch my game, the menu screen appears without any reward video ads showing but on iOS reward video shows before you even start playing game and its annoying.
So Apple rejected my update until I fix that bit but I have no idea why the video is showing at start since its only meant to appear based on a button trigger.
-
Also the banner ads does not show in the menu scene when you launch game but it only then shows when you enter game scene and come out of it.
-
Still not sure why there is a delay with reward video when you click the button to show video and reward user.
Thanks for your help
This is my setup:
build.settings
settings = { plugins = { -- Base ["plugin.appodeal.base"] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.StartApp'] = { publisherId = 'com.coronalabs' }, -- Banner ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.MillenialMedia'] = { publisherId = 'com.coronalabs' }, -- Interstitial ['plugin.appodeal.Chartboost'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, -- Rewarded Video ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Chartboost'] = { publisherId = 'com.coronalabs' }, -- Others ["CoronaProvider.native.popup.social"] = { publisherId = "com.coronalabs" }, ["CoronaProvider.native.popup.activity"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, ["plugin.google.iap.v3"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", supportedPlatforms = { android = true }, }, ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, }, orientation = { default = "portrait", --landscapeRight supported = { "portrait", } }, iphone = { xcassets = "Images.xcassets", plist = { UIStatusBarHidden = true, }, }, android = { googlePlayGamesAppId = "1018252850656", --insert your app id number for google game services usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.READ\_PHONE\_STATE", "android.permission.WRITE\_EXTERNAL\_STORAGE", "com.android.vending.BILLING", } } }
menu.lua
-- Functions local buttonTouched local rewardType = nil -- appodeal init local appodeal = require( "plugin.appodeal" ) -- appodeal local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization print( event.isError ) -- Load an appodeal ad appodeal.load( "banner" ) appodeal.load( "interstitial" ) elseif ( event.phase == "loaded" ) then -- The ad was successfully loaded print( event.type ) -- Show the ad appodeal.show("rewardedVideo") elseif ( event.phase == "failed" ) then -- The ad failed to load print( event.type ) print( event.isError ) print( event.response ) elseif ( event.phase == "displayed" or event.phase == "playbackBegan" ) then -- The ad was displayed/played print( event.type ) elseif ( event.phase == "playbackEnded" ) then -- The ad was closed/hidden print( event.type ) if rewardType == "buyshuffle" then utils.shuffles = utils.shuffles + 1 label\_shuffle.text = "+" ..utils.shuffles utils.playSound("cash") utils.savePlayerInfo() elseif rewardType == "buysaveme" then utils.savecount = utils.savecount + 1 label\_saveme.text = "+" ..utils.savecount utils.playSound("cash") utils.savePlayerInfo() end elseif ( event.phase == "clicked" ) then -- The ad was clicked/tapped print( event.type ) end end -- Initialize the appodeal plugin appodeal.init( adListener, { appKey="xxxxxxxxxxxxx", disableAutoCacheForAdTypes={"banner", "interstitial", "rewardedVideo"}, disableWriteExternalPermissionCheck=true, supportedAdTypes={"banner", "interstitial", "rewardedVideo"} } ) local function buttonPress(event) if event.phase == "ended" then rewardType = event.target.reward appodeal.load( rewardedVideo ) end end function scene:create( event ) -- Display Shuffle buy button local button\_buyshuffle = display.newSprite(uiSheet, {frames={uiSheetInfo:getFrameIndex("buyshuffle")}}) button\_buyshuffle.x = \_W\*0.5 - button\_buyshuffle.width/2 - 0.5 button\_buyshuffle.y = mF(button\_rate.y + (button\_rate.height\*0.5) + (button\_rate.height\*0.5) + 3) button\_buyshuffle.reward = "buyshuffle" button\_buyshuffle:addEventListener("touch", buttonPress) uiGroup:insert(button\_buyshuffle)