Error on slow connections

Hi,

We are using fullscreen ad preloading and then displaying it when we want it.
When experiencing some network issues ads were not loaded before we called “show()” function.
After calling it, we have received an error [this one is from version 5.0, but we saw that earlier]:

[lua]
2013-03-04 15:51:27.159 Corona Simulator[12496:903] Runtime error
/dist/revmob.lua:607: bad argument #-2 to ‘insert’ (Proxy expected, got nil)
stack traceback:
[C]: ?
[C]: in function ‘insert’
/dist/revmob.lua:607: in function ‘_updateResourcesLoaded’
/dist/revmob.lua:589: in function
(tail call): ?
?: in function <?:463>
[/lua]

The funny part is, that before calling “:insert()”, there is a call to “isLoaded()” function, which checks if the image and closeButtonImage are loaded.
This looks very strange to me, but happens on a daily basis. The only thing I know about it, is that this error is thrown when calling “:show()” before listener receives “adReceived” event.

This is happening for fullscreen ads [we don’t preload banners].

Thanks,
Krystian
[import]uid: 109453 topic_id: 36778 reply_id: 336778[/import]

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]

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]

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]

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]

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]