Error on slow connections

Hi Krystian,

Do you eventually receive an adReceived event into your listener, or do you never receive one?

In my case, I only call :show() after receiving an adReceived event, and I haven’t encountered any issues (yet).

  • Andrew [import]uid: 109711 topic_id: 36778 reply_id: 145071[/import]

Another update.

It’s got nothing to do with displaying the ad or not.
This error is thrown when the ad is received. I’m not sure whether it’s because of my connection or some issues with revmob, but currently I get a lot of timeouts for revmob requests.
I think revmob folks need to add some kind of additional check, or improve the one from isLoaded, because clearly it fails.

[import]uid: 109453 topic_id: 36778 reply_id: 145073[/import]

I see. So the error is thrown merely by loading a full screen ad when the network connectivity is poor, even if you make no other API calls thereafter (i.e., no call to :show())? [import]uid: 109711 topic_id: 36778 reply_id: 145081[/import]

Exactly.

After this error, when I call :show() I will get an ad without the close button. [import]uid: 109453 topic_id: 36778 reply_id: 145083[/import]

I see. So the error is thrown before you make any other API calls, but the issue from a user standpoint (seeing an ad without a close button) doesn’t happen until after you actually call :show().

In that case, my question would be whether your listener receives an adReceived event? If not, then I would not call :show(). True, the error will still spit out in the log, but from the user’s standpoint there will be no issue. [import]uid: 109711 topic_id: 36778 reply_id: 145085[/import]

oh come on, I’ve already said it twice.
I do get the adReceived event. [import]uid: 109453 topic_id: 36778 reply_id: 145127[/import]

Hi Krystian,

No need to be testy, I’m just trying to help. Looking back at the chain, you only referred to the adReceived event once, in your initial post, where you said “that this error is thrown when calling ‘:show()’ before listener receives ‘adReceived’ event”. Since it wouldn’t make sense to call :show() before getting an adReceived event, I was interpreting what you said to mean that you weren’t getting an adReceived event at all. But apparently, you are getting one.

When does the error throw? Is it immediately after calling loadFullScreen(), 5 seconds later, 30 seconds later…? Is it always the same length of time after, or is it variable?

Do you call :show() as and only when you receive an adReceived event, or do you call :show() based on some sort of independent timer after you call loadFullScreen()?

I’d be happy to look at any code you’d like to share, if helpful.

  • Andrew [import]uid: 109711 topic_id: 36778 reply_id: 145128[/import]

Hi Andrew,

sorry about that.

Error is thrown in _updateResourcesLoaded function which is called after the resources are downloaded [at least this is what I get looking at the code].
I call show some time later, depends on user interaction. Error has nothing to do with calls to show() function.

I’m not really sure what kind of code sample would you like me to provide.
The only way to reproduce it is to call
[lua]
RevMob.createFullscreen(listener, PLACEMENT)
[/lua]
and have a crappy connection.
[import]uid: 109453 topic_id: 36778 reply_id: 145199[/import]

Hey Krystian, no worries.

It does seem like a strange error. I’m impressed you’re attempting to trace it through the obfuscated RevMob SDK code…!

I’ll try it next time I find myself with a poor connection and see if I can reproduce it. I wonder if it happens with other preloaded ads too, like popups and links. Do you happen to know if it’s happening only when you use the placement feature, or does it happen even if you don’t use a specific placement?

  • Andrew [import]uid: 109711 topic_id: 36778 reply_id: 145258[/import]

I don’t think it’s got anything to do with placement code.
I haven’t seen this happening to banner ads, I only use banners and fullscreens. [import]uid: 109453 topic_id: 36778 reply_id: 145268[/import]

The most irritating thing about this error, is that there’s no recovery!
Once I get the ‘adReceived’ message in my listener I believe it is ok to display it.
I think I will move the listener call after the images are inserted to the group. This way, in case of an error, user will simply not see any full screen ads [which in the end will make him happy rather than angry because he can’t close the damn ad].

EDIT:

Just a followup.
In order to get rid of this issue I have modified revmob.lua in a following way:

[lines ~ 606-608]
From:
[lua]
n.release(“Fullscreen loaded”)if e.listener~=nil then e.listener({type=o.AD_RECEIVED,ad=i})end
e.component:insert(1,e.image)
e.component:insert(2,e.closeButtonImage)
[/lua]

To:
[lua]
n.release(“Fullscreen loaded”)
e.component:insert(1,e.image)
e.component:insert(2,e.closeButtonImage)
if e.listener~=nil then e.listener({type=o.AD_RECEIVED,ad=i})end
[/lua]

This way, when this error happens, my user will simply not see the ad, instead of getting the ad without close button. [import]uid: 109453 topic_id: 36778 reply_id: 145386[/import]

Hi Krystian, thank you for sharing this

i have a similar situation with yours, i preload a fullscreen ad and after it has been received i call the :show() method

after reading your post, i’ve been trying to reproduce it with a poor network connection, but i never get the error that you mention. the X button always shows up in the fullscreen ad.

how do you get the “crappy” connection that you mention?
do you turn wifi off and try with 3G? do you turn off 3G and move away from the router?

 

have you tried pcall? 

local function fullscreenShow() fullscreen:show() end if not pcall(fullscreenShow) then print("the close button is missing") fullscreen:hide() end

I think this is a “feature” of our network, that it looses packets from time to time.

Error does not come up during show() call. It’s thrown when images are received, this is “asynchronous” inside the revmob code.

Later, when I call “show()” it will simply show the fullscreen ad without the close button, without any errors.

 

I will try to modify the revmob code even more and add there the pcall, and check if both of the images were added.

 

Thanks!

Additional detail:

it seems that the problem is within close button image.
Ad is shown on screen after the error, but the close button is missing and user is unable to close the ad. [import]uid: 109453 topic_id: 36778 reply_id: 145063[/import]

Hi Krystian,

Do you eventually receive an adReceived event into your listener, or do you never receive one?

In my case, I only call :show() after receiving an adReceived event, and I haven’t encountered any issues (yet).

  • Andrew [import]uid: 109711 topic_id: 36778 reply_id: 145071[/import]

Another update.

It’s got nothing to do with displaying the ad or not.
This error is thrown when the ad is received. I’m not sure whether it’s because of my connection or some issues with revmob, but currently I get a lot of timeouts for revmob requests.
I think revmob folks need to add some kind of additional check, or improve the one from isLoaded, because clearly it fails.

[import]uid: 109453 topic_id: 36778 reply_id: 145073[/import]

I see. So the error is thrown merely by loading a full screen ad when the network connectivity is poor, even if you make no other API calls thereafter (i.e., no call to :show())? [import]uid: 109711 topic_id: 36778 reply_id: 145081[/import]

Exactly.

After this error, when I call :show() I will get an ad without the close button. [import]uid: 109453 topic_id: 36778 reply_id: 145083[/import]

I see. So the error is thrown before you make any other API calls, but the issue from a user standpoint (seeing an ad without a close button) doesn’t happen until after you actually call :show().

In that case, my question would be whether your listener receives an adReceived event? If not, then I would not call :show(). True, the error will still spit out in the log, but from the user’s standpoint there will be no issue. [import]uid: 109711 topic_id: 36778 reply_id: 145085[/import]

you are welcome!
good luck with your project