[Appodeal]App Rejected - Reward Video showing on game menu for iOS

Hi all, not sure why this is happening to me but for unknown reasons:

  1. 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.

  1. 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.

  2. 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)

Ok. So many issues with this code buddy and so little time.

  1. First especially for the base items for Appodeal you should really not remove any unless it is absolutely necessary and that especially is true for Admob.

  2. There is no reason to repeat the same plugin over and over. The comment lines don’t mean anything to Corona. They are there for the humans. So you only need one of each plugin.

  3. Why disable auto cache of the banner and interstitial, if you are going to load them immediately.

    appodeal.load( “banner” ) appodeal.load( “interstitial” )

  4. The reward video is showing because when one of above-mentioned ad type loads you don’t check what type it is and show the reward.

    elseif ( event.phase == “loaded” ) then – The ad was successfully loaded print( event.type ) – Show the ad appodeal.show(“rewardedVideo”)

What I would do:

  1. Add the base items back.

  2. Remove the duplicate plugins.

  3. Remove this line from the init. Even if you wanted to turn off autoCache you are missing a bunch of code to deal with the autocache off.

    disableAutoCacheForAdTypes={“banner”, “interstitial”, “rewardedVideo”},

  4. Change this part of the if statement to:

    if ( event.phase == “init” ) then – Successful initialization print( event.isError ) – Load an appodeal ad appodeal.show( “banner” )

  5. Delete the show of the reward video in the next if statement:

    – Show the ad appodeal.show(“rewardedVideo”)

  6. Remove the load call to appodeal in the button press and just show the reward video.

    appodeal.show(“rewardedVideo”)

That being said I don’t think the reward code will work as you intended but fix the above and we will tackle the next set.

Thanks @agramonte I am on it now. Will update you when done.

Please where did I duplicate plugin?

You are awesome. All looks to be working fine as expected and reward is working as well. The banner appears to be showing test ads in it and not sure why

Qv9ZrX.jpg

You are welcomed. For duplicates, I struck out the ones that are duplicate.

-- Banner ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.MillenialMedia'] = { publisherId = 'com.coronalabs' }, -- Interstitial ['plugin.appodeal.Chartboost'] = { publisherId = 'com.coronalabs' }, --Remove ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, -- Rewarded Video --Remove ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, --Remove ['plugin.appodeal.Chartboost'] = { publisherId = 'com.coronalabs' },

I don’t see you have it set to test ads so I suspect that you are missing something on the Appodeal site and they have marked you as test only. Start a conversation with somebody on appodeal site and they’ll respond fairly quickly.

Glad it is all working.

Ok. So many issues with this code buddy and so little time.

  1. First especially for the base items for Appodeal you should really not remove any unless it is absolutely necessary and that especially is true for Admob.

  2. There is no reason to repeat the same plugin over and over. The comment lines don’t mean anything to Corona. They are there for the humans. So you only need one of each plugin.

  3. Why disable auto cache of the banner and interstitial, if you are going to load them immediately.

    appodeal.load( “banner” ) appodeal.load( “interstitial” )

  4. The reward video is showing because when one of above-mentioned ad type loads you don’t check what type it is and show the reward.

    elseif ( event.phase == “loaded” ) then – The ad was successfully loaded print( event.type ) – Show the ad appodeal.show(“rewardedVideo”)

What I would do:

  1. Add the base items back.

  2. Remove the duplicate plugins.

  3. Remove this line from the init. Even if you wanted to turn off autoCache you are missing a bunch of code to deal with the autocache off.

    disableAutoCacheForAdTypes={“banner”, “interstitial”, “rewardedVideo”},

  4. Change this part of the if statement to:

    if ( event.phase == “init” ) then – Successful initialization print( event.isError ) – Load an appodeal ad appodeal.show( “banner” )

  5. Delete the show of the reward video in the next if statement:

    – Show the ad appodeal.show(“rewardedVideo”)

  6. Remove the load call to appodeal in the button press and just show the reward video.

    appodeal.show(“rewardedVideo”)

That being said I don’t think the reward code will work as you intended but fix the above and we will tackle the next set.

Thanks @agramonte I am on it now. Will update you when done.

Please where did I duplicate plugin?

You are awesome. All looks to be working fine as expected and reward is working as well. The banner appears to be showing test ads in it and not sure why

Qv9ZrX.jpg

You are welcomed. For duplicates, I struck out the ones that are duplicate.

-- Banner ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.MillenialMedia'] = { publisherId = 'com.coronalabs' }, -- Interstitial ['plugin.appodeal.Chartboost'] = { publisherId = 'com.coronalabs' }, --Remove ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, -- Rewarded Video --Remove ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, --Remove ['plugin.appodeal.Chartboost'] = { publisherId = 'com.coronalabs' },

I don’t see you have it set to test ads so I suspect that you are missing something on the Appodeal site and they have marked you as test only. Start a conversation with somebody on appodeal site and they’ll respond fairly quickly.

Glad it is all working.