问题
We are working on an Apple Watch project, but the watch goes to sleep if uninterrupted with.
Is there any way to prevent it from going to sleep?
回答1:
As of my knowledge and other searches on this topic, at the moment is no api
available to enable or even disable sleep mode for Apple Watch programmatically.
回答2:
No-Sleep API
Currently, there is no API to disable Apple Watch from going to sleep.
You may wait until watchOS 3.
Changing Sleep Time By User
Any user can go to this path:
Settings -> General -> Wake Screen
And set the time to a long time.
Unfortunately, only the user can change this and there is no way to do it programmatically.
NOTE: If you want the screen to resume your activity after waking up, you should ask user to do so here:
Settings -> General -> Wake Screen -> Resume Last Activity
Note that according to Owen, keeping the watch awake would kill the battery quickly.
Conclusion
1- No API is set.
2- User can change sleep time.
3- User can select to resume last activity when the Apple Watch wakes up.
回答3:
Because of the power requirements, keeping the watch awake would kill the battery quickly. However, you may be concerned that when the watch does go to sleep, it doesn't re-wake to your app. This can be remedied at the user level, on your iOS device using the Watch App, using General->Wake Screen-> and checking "Resume Last Activity"
来源:https://stackoverflow.com/questions/35393307/how-to-prevent-the-apple-watch-from-going-to-sleep