Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Vungle display layer under current scene.
Started by MochiBits Aug 01 2013 12:23 PM

5 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

MochiBits

[GLOBAL: userInfoPane.html]
MochiBits
  • Contributor

  • 134 posts
  • Enterprise

I have the vungle plugin working, but for some reason it's showing below the current display group/layer.

 

It starts, then I can hear the ad, but it quickly disappears under my current display group.

 

Anyone seen this?



[TOPIC: post.html]
#2

DavidRangel

[GLOBAL: userInfoPane.html]
DavidRangel
  • Moderator

  • 888 posts
  • Corona Staff

Kyle - I will ask Vungle to take a look because it may depend on their implementation (e.g., where a UIView is in the hierarchy). 



[TOPIC: post.html]
#3

MochiBits

[GLOBAL: userInfoPane.html]
MochiBits
  • Contributor

  • 134 posts
  • Enterprise

Thanks David.



[TOPIC: post.html]
#4

MAS1

[GLOBAL: userInfoPane.html]
MAS1
  • Contributor

  • 279 posts
  • Corona SDK

MochBits,

 

"It starts, then I can hear the ad, but it quickly disappears under my current display group."

 

Yes - I have seen (and heard!) this. Where are you calling ads.show()? Would it be in a native.showAlert() listener/callback? 

 

If so, set a delay of 1000 ms in the listener/callback before calling ads.show(). You'll likely get away with less than 1000 ms but 100 ms didn't work for me. If you are not calling ads.show() in a listener/callback of any kind then just call ads.show() with a, say, 5000 ms delay from app start and check that it works and work forward from there with the knowledge that your issue is perhaps down to where the call to ads.show() is placed.

 

I don't like the idea of showing a video ad without asking the user's permission (for some reward, of course). Hence my use of native.showAlert() and the associated listener. My guess is that this gotcha of calling ads.show() in the/a listener will trip people up.

 

Hope this helps!

 

Martin.



[TOPIC: post.html]
#5

MochiBits

[GLOBAL: userInfoPane.html]
MochiBits
  • Contributor

  • 134 posts
  • Enterprise

 If so, set a delay of 1000 ms in the listener/callback before calling ads.show().  

 

This did it! I bow down! Thanks! :D

 

Here's the little snippet I used...

timer.performWithDelay(1000,
  function()
    ads.show("interstitial")
    ads.isAdAvailable()
  end
) 


[TOPIC: post.html]
#6

MAS1

[GLOBAL: userInfoPane.html]
MAS1
  • Contributor

  • 279 posts
  • Corona SDK

@ MochiBits

 

Glad that helped. My code tests for ads.isAdAvailable() and if true native.showAlert("Message asking if player wants to view a video for reward"). Then in the native.showAlert() listener I apply the 1000 ms delay to ads.show().

 

TBH I've experienced a few problems calling functions in listeners in Corona where a delay can often fix the issue. I had a bug for hours combining the native keyboard and twitter popup and it really stumped me. The delay technique worked in that instance too. :-)

 

Best,

 

Martin.




[topic_controls]
[/topic_controls]