Events on aplicationSuspend

Ok i need help, i am trying to run a timer by many loops while the application is suspended, but it is doing only one time

local onSystem = function( event )

   if event.type == “applicationSuspend” then

       timer.performWithDelay(4000,listener(),5)

   end

end

Runtime:addEventListener( “system”, onSystem )

Corona apps do not run when they are suspended. It does not process background events.

Rob

Ok, thanks for your reply

ok i am here again specifically i need to consume a web service to send the location of the device when it is in the background (suspend).

in the example that i have send before the timer run one time automatically because i have calling that forcibly with the parenthesis, but if i call this normally that run when enter of the suspension

thanks i am pending, i really need to do this process

I am not sure I should open a new thread, but I think there is a problem with iOS 8 when the app is suspended - I tested on my old iPhone 4s and when I close the app (home button on iPhone) while the audio is playing it goes on this funny very short loop and doesn’t stop until you start music app or some other app with audio. I thought it was just my app, but I have just tried some of Roamnig Gamer apps that are on the App Store and it does the same. All works fine on later devices. Any ideas?

@odisej,

If you didn’t start the thread, and if you are not answering the original question, then “Yes”, you should start a new thread. 

You should only add comments to a thread to answer it.  If you’re asking a question, elaborating on a old problem that was resolved in a thread, or if you re-encounter the same issue, you still want to start a new thread. 

If the old thread is related, then link it in your new thread.  

This may seem extreme, but it keeps threads clean, short, and pertinent which helps everyone in the end.

I will be awaiting your new post.  When you start it, please list the apps you mentioned and where you got them.  i.e. Were they my apps on the app store or from some examples I wrote time time ago.  This will help me when trying to help debug.

Corona apps do not run when they are suspended. It does not process background events.

Rob

Ok, thanks for your reply

ok i am here again specifically i need to consume a web service to send the location of the device when it is in the background (suspend).

in the example that i have send before the timer run one time automatically because i have calling that forcibly with the parenthesis, but if i call this normally that run when enter of the suspension

thanks i am pending, i really need to do this process

To address your first question, you could add an Runtime enterFrame listener if you need to keep track of time passed, and from there, take appropiate action once the application resumes.

I am not sure I should open a new thread, but I think there is a problem with iOS 8 when the app is suspended - I tested on my old iPhone 4s and when I close the app (home button on iPhone) while the audio is playing it goes on this funny very short loop and doesn’t stop until you start music app or some other app with audio. I thought it was just my app, but I have just tried some of Roamnig Gamer apps that are on the App Store and it does the same. All works fine on later devices. Any ideas?

@odisej,

If you didn’t start the thread, and if you are not answering the original question, then “Yes”, you should start a new thread. 

You should only add comments to a thread to answer it.  If you’re asking a question, elaborating on a old problem that was resolved in a thread, or if you re-encounter the same issue, you still want to start a new thread. 

If the old thread is related, then link it in your new thread.  

This may seem extreme, but it keeps threads clean, short, and pertinent which helps everyone in the end.

I will be awaiting your new post.  When you start it, please list the apps you mentioned and where you got them.  i.e. Were they my apps on the app store or from some examples I wrote time time ago.  This will help me when trying to help debug.

To address your first question, you could add an Runtime enterFrame listener if you need to keep track of time passed, and from there, take appropiate action once the application resumes.