Hello!
Need some help with network requests…
I try to upload photo from app to remote server,
code something like that:
-
get from db all photo, with status = ‘nosend’
-
for every row, change status to ‘in send’ and send photo to server
network.upload( req , “POST”, networkListener, params, filename, system.DocumentsDirectory )
in listener
local function networkListener( event ) if event.isError then -- change status back to 'nosend' else if event.phase == "ended" then if event.status == 200 then -- change status to 'send' end end end return true end
in case app suspend and then back to screen - all ok, status change to ‘send’ or ‘nosend’ depending on the event
in case app suspend and then exit - status dont change, but photo may be delivered to server
My question: whether I can to check delivery for a server ?
Have a Corona team a instructions or a examples: network.requests with different app status (applicationSuspend/applicationExit)?
Thank for answering!
p.s.
sorry, my english is terrible