Calling a function while app is closed

Can I call a function in an app while it is closed ? For example if I have to check the time on the user’s device while the app is not open can this be done in any way ?

Corona apps don’t run in the background.

I know it doesn’t run on background, I meant only calling a function through a certain service for example…or does a corona app becomes completly inactive and cannot access it or call a function in the app in any way ?

The latter is correct. If the Corona built app is not active and on the screen of a device, it will not be actively executing your code. Some exceptions apply like push notifications from 3rd party services, but by and large the app will be dormant.

( Re-posted )

@Nerox,

Oh.  Well, you didn’t say you knew that “it doesn’t run on background” in your original post, so I assumed you didn’t know this.

To be clear,  

  • Not running ==
    • Completely inactive.
    • Not calling functions from within the code.
    • Not responding to external events.

In short, AFAIK, there is no way your Corona app can check the time on the user’s device when your app is suspended.

PS - I suspect you were hoping there is some way to temporarily un-suspend the app without raising it to the foreground.  That too won’t happen.  Sorry.  Corona apps are either in the foreground or sleeping.

Corona apps don’t run in the background.

I know it doesn’t run on background, I meant only calling a function through a certain service for example…or does a corona app becomes completly inactive and cannot access it or call a function in the app in any way ?

The latter is correct. If the Corona built app is not active and on the screen of a device, it will not be actively executing your code. Some exceptions apply like push notifications from 3rd party services, but by and large the app will be dormant.

( Re-posted )

@Nerox,

Oh.  Well, you didn’t say you knew that “it doesn’t run on background” in your original post, so I assumed you didn’t know this.

To be clear,  

  • Not running ==
    • Completely inactive.
    • Not calling functions from within the code.
    • Not responding to external events.

In short, AFAIK, there is no way your Corona app can check the time on the user’s device when your app is suspended.

PS - I suspect you were hoping there is some way to temporarily un-suspend the app without raising it to the foreground.  That too won’t happen.  Sorry.  Corona apps are either in the foreground or sleeping.