Skip to main content


 

Inconsequential iOS app time management gripe


Many mobile games use timers and rely on the underlying phone OS to give them a sense of how much time passed between two app uses.

Unfortunately on iOS sometimes apps are woken up in the exact state they were left off, without having any clue actual time has passed.

This is extremely irritating when picking up a game in the morning since mobile games are designed with sleep time in mind, with 8+ hours timers.

I’m guessing this is an intended behavior to provide a seamless app experience but in this specific case it backfires.

#ios #mobile #videogame
Game programming is remarkably difficult. Setting up a frame (and framework) in which the developer can have a consistent model of the game physics is a critical first step.

I'm not blaming the game programmers, like I said they are relying on the OS to get a representation of time passed. I still remember when you could cheat certain games by changing your computer's date.

In this case I feel like Apple are betraying them by providing a way to ignore any length of time between to app runs.

How would that be Apple's fault? They have an API to get the time; it's up to the developer to decide how that applies into their game's physics.

The normal behavior is:
- App is closed
- X Time passes
- App is reopened, shows a pop-up "You've been away for X Time)

The abnormal behavior is:
- App is closed
- X Time passes
- App is reopened and picks up exactly where it was closed with no time passed pop-up and timers haven't decreased

The reason why I'm blaming Apple is because the abnormal behavior isn't consistent and can be witnessed on several unrelated apps. I believe there are certain conditions that make iOS "fool" apps by not sending the correct time passed event.

To the best of my knowledge there is event of time passing; there's a clock and you read it. It's up to you as a developer to read it and interpret what the results mean to you. There are events you can subscribe to for activation/deactivation of your app and the device, again it's up to you to do so, record the deactivation time, record the re-activation time, and behave appropriately.

And the games I mentioned all do that, hence the pop-up "You've been gone for X Time". But sometimes it doesn't happen, and I'm hard-pressed to find out exactly why. All I know is that forcibly quitting the app removes the issue, and on the contrary it will more likely happen when locking the phone while using the app and unlocking the app later going directly to the same app.

last thing anyone needs

time bullies

done't EVER allow other people's time preferences to ruin your life

anyway wouldn't getting the time on ios be similar to aything else?
... eg a system call .. guessing probably similar to what you'd call on bsd

on freebsd there are man pages for what those are in c

those just get the current system clock time, not time elapsed or anything like that

for time elapsed the app probably just compares that with a time it stored earlier.
This entry was edited (24 hours ago)