Vungle display layer under current scene.

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?

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

Thanks David.

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.

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

Here’s the little snippet I used…

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

@ 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. :slight_smile:

Best,

Martin.

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

Thanks David.

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.

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

Here’s the little snippet I used…

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

@ 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. :slight_smile:

Best,

Martin.