Enable iPhone accelerometer while screen is locked

前端 未结 2 956
不思量自难忘°
不思量自难忘° 2020-12-10 15:26

So apparently it is possible to keep the processor going processing stuff while the screen is locked, as indicated here:

Running IPhone apps while in sleep mode

相关标签:
2条回答
  • 2020-12-10 15:35

    I haven't tried this but if you've tired the workaround and it didn't work then it's possible that Apple patched out the hack. The link that gives the work around is from Sept 09 and we've had at least one OS update since then.

    0 讨论(0)
  • 2020-12-10 15:47

    There was a bug in iPhone OS prior to 3.1.2 that caused the accelerometer to stop returning values as soon as the screen was blanked. You may be running into this same issue. I filed a bug with Apple about it and they fixed it in 3.1.2.

    One trick I use in an app is to enable the proximity sensor. This allows my app to continue running, but if the user puts their phone in their pocket or otherwise trips the sensor, the screen turns off and doesn't consume power. Meanwhile, my app is still running and (3.1.2 or later) the accelerometer continues sending updates.

    0 讨论(0)
提交回复
热议问题