Tracking total play time

What would be the easiest method to track a players total play time (or time while the app is open) that can be presented in the form of a stats page? Thanks

Comments

  • adam36021adam36021 Member, PRO Posts: 45

    game.time will return the game time in seconds, that is time that the app is spent active.

    devices.clock.epochTime can be used to track time since first opening the app -- this tells you the elapsed time since Jan 1,1970. You can do some math using different time stamps to pull off things, like if you want a button to work once every real-time 24 hours, for example.

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,170

    FYI, epochTime is only available i the HTML5 engine for now. We'll add it to the native engine soon, but it's a bit harder.

    The way people currently deal with it is to use a server to get the current time and then use the game.time to count up since then.

  • adriangomezadriangomez Member, PRO Posts: 440

    You also have some external options. You can use Tapjoy through the iron source mediation to display alerts at certain intervals based on session length. You can also use one of many external connection options to accomplish this. If you let me know what you want to show maybe I can help you.

Sign In or Register to comment.