Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Is it normal for adView/adEnd to be called twice each for one ad?
Started by jflowers45 Sep 23 2014 10:29 PM

3 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

jflowers45

[GLOBAL: userInfoPane.html]
jflowers45
  • Contributor

  • 320 posts
  • Enterprise

I'm using Vungle incentivized ads with corona build 2014.2438 and the facebook build.settings workaround.

 

adStart is only firing once - but I'm seeing adView and adEnd get called 2x when an ad completes - and it's happening for both the type of ad that has a "closing banner" (in other words you have to close the ad by hitting the x when its  over, example "campus life" ad) or one without the closing banner (e.g. TubeMogul)

 

Is this normal?



[TOPIC: post.html]
#2

jcsastre0

[GLOBAL: userInfoPane.html]
jcsastre0
  • Observer

  • 5 posts
  • Corona SDK

I'm having the same problem...



[TOPIC: post.html]
#3

cmontesino

[GLOBAL: userInfoPane.html]
cmontesino
  • Enthusiast

  • 93 posts
  • Corona SDK

I'm on the same boat :/ 

 

I'm trying incentivized videos and I'm getting two adView (and two adEnd) events after watching a video:

 

From the terminal:

I/Corona  ( 8877): onSystemEVENT.type:applicationResume

I/Corona  ( 8877): event.type: adEnd

I/Corona  ( 8877): event.type: adView

I/Corona  ( 8877): event.type: adView

I/Corona  ( 8877): event.type: adEnd

 

causing me to reward twice for a single video view. This didn't happen before with the same code.



[TOPIC: post.html]
#4

cmontesino

[GLOBAL: userInfoPane.html]
cmontesino
  • Enthusiast

  • 93 posts
  • Corona SDK

I have a workaround for the meantime :) 

 

I'm using a variable, named currentlyPlaying, it starts as "false"(1) at the start of the game then I make it true(2) when the video plays and finally at the adView event I make it false again(3,4). So at the adView event I check to see wether a video is playing. Simple and it works, I'm hoping for a proper fix as you guys.

 

 

local currentlyPlaying = false  --1
 
function vungleListener( event )
  print("event.type: ", event.type)
  print("currentlyPlaying: ", tostring(currentlyPlaying))
 
    if ( event.type == "adStart" and event.isError ) then
      currentlyPlaying = false
    elseif ( event.type == "adStart" and not event.isError ) then
       currentlyPlaying = true  --2 
    end
 
    if ( event.type == "adView" and event.isCompletedView and currentlyPlaying == true) then -- CHECK  currentlyPlaying
    
     -- REWARD
      currentlyPlaying = false --3
     
    elseif ( event.type == "adView" and event.isCompletedView == false and currentlyPlaying == true) then -- CHECK  currentlyPlaying
 
     -- NO REWARD   
      currentlyPlaying = false --4
 
    end
 
 
end



[topic_controls]
[/topic_controls]