Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

how to check app open/close

CaptainChocoCaptainChoco Posts: 124Member, BASIC

I want to make an event which starts when the app is closed(or sleep mode...) to give the offline-rewards to the player.
Is there any way to check those states???

For now, I'm trying to save the event-start time and event-end time...


  • tatiangtatiang Posts: 11,408Member, Sous Chef, PRO, Senior Sous-Chef

    No. You can determine when the app has been re-opened but not when it has been closed/slept.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • CaptainChocoCaptainChoco Posts: 124Member, BASIC

    Thanks~! I'd better change the logic. :D :D

  • ArmellineArmelline Posts: 4,619Member, PRO
    edited March 6

    You can keep a record every second of the number of seconds since a specific date. Then when the app is closed and reopened, you can compare the recorded value to the current number of seconds since that specific date. This tells you how long the app was closed - and also, effectively, when it was closed.

    I have a template on GSHelper (though GSHelper seems to be down atm) that does this, but be warned that implementing this kind of logic project wide isn't easy!

Sign In or Register to comment.