network.request response when app is suspended

I could not find any specific documentation nor any other questions regarding this.

If your app calls a network.request and the user suspends the app before there is a response, what happens to the network.request? Is it supposed to time-out? [import]uid: 56820 topic_id: 27355 reply_id: 327355[/import]

I would assume the response is received by the hardware and possibly cached until it can be consumed by the application. The problem, IMHO, would be that the application may not resume, so either iOS will dump the message or it will be delivered but there might no longer be a listener for it to be received by.

Either way, the upshot would be that either it’s received after a delay (coming back to your app) or it fails completely but your app won’t know that it failed anyway. This would be one advantage of asynchronous network calls, I suppose.

Have you actually tried it? [import]uid: 8271 topic_id: 27355 reply_id: 111124[/import]

The Lua listener will not be called while your app is suspended. I’ve tested and confirmed this to be true on Android and Corona Simulator for Windows.

That said, Corona will still listen for a network response and do network downloads while your app is suspended. Once completed or failed, the event will be queued and your Lua listener will then be invoked once your app has been resumed. [import]uid: 32256 topic_id: 27355 reply_id: 111205[/import]

Good to know. Thanks for the responses. [import]uid: 56820 topic_id: 27355 reply_id: 111383[/import]