how to check app open/close
CaptainChoco
Member, BASIC Posts: 124
Hello
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...
Comments
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
Thanks~! I'd better change the logic.
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!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support