Any suggestions here?
I also noticed that the same thing occurs with applicationSuspend. When applicationResume is triggered, the previous network request in applicationSuspend completes, followed by the new request in applicationSuspend
What techniques do people use to utilize network.request() and more importantly, handle the response, when the application suspends or exits?
I’m fairly stymied here. It seems callbacks aren’t fully working in these events listeners.
[blockcode]
local serviceUrl=“http://company.com/echo_post”
local responseText=display.newText("",150,50 )
local function postListener(event)
print(“Response: " … event.response)
print(”-----------------------")
print("\n")
responseText.text = event.response
end
local function onSystemEvent( event )
print( “System event name and type: " … event.name, event.type )
local postData={
type = event.type
}
local params={}
params.body=“event=”…event.type
network.request(serviceUrl…”/"…event.type,“POST”,postListener,params)
end
Runtime:addEventListener( “system”, onSystemEvent )
[/blockcode]
[blockcode]
<?php
print\_r($\_POST);
?\>
[/blockcode]
I understand that the display object may not update, that seems normal -- but tailing my log file, it's apparent that the request is never even sent in those states.
Works fine from the term/sim.
There was a similar bug report about this in the old forum, but saw no history of it in the new bug system: http://developer.coronalabs.com/forum/2012/07/06/networkrequest-not-possible-applicationsuspend-event
I even tried the daily builds from yesterday, same issue.
[import]uid: 1989 topic\_id: 29001 reply\_id: 116829[/import]