Is there any way to keep a watch app active in watchOS 2?

Even if the watch must deactivate the app when a user lowers there wrist (though preferrably not) we desparately need for apps to be guaranteed to become active again when the wrist is raised again. An opt-in would be the perfect option. Obviously not all apps should do this so you'd want a way for users to decide.


I develop a fitness timer app that users check regularly. Once tired and sweaty if the user raises their wrist and the app is no longer there it's too much to ask for them to use the fiddly app selector interface to get the app back. At that point they probably just assume the app has crashed and will no longer use it. And who can blame them.


The only option is to select that the last activity always becomes active, but who wants their watch to do that? If this has not been addressed yet, it absolutely needs to be.


I'm currently in the ludicrious position of telling the users that are asking for a watch app that the Apple watch is no good for timing apps!

Replies

By the sounds of it yes!


The

HKWorkoutSession
class describes the properties of a workout session. Workout sessions let apps continue to run in the foreground. The app appears whenever the user wakes the device, unless the user dismissed the app by pressing the crown. This lets the user check on the status of the workout by simply raising their wrist.


https://developer.apple.com/library/prerelease/watchos/documentation/HealthKit/Reference/HKWorkoutSession_ClassReference/

This is a good find.


The documentation is a little confusing. It says that the app continues to run in the foreground, which seems to imply that my app can send out a haptic to alert the user of something.


But it also states that the 'app appears whenever the user wakes the device'. I gather this to really mean that the screen turns on when the user presses the button or moves his/her wrist. The watch is really not 'sleeping' - it's actively running the application, updating the screen, etc. You just can't 'see' the screen unless you 'turn on the screen'.

Apple's bending the definition of foreground. Apple Watch previously shut the app down so you ahd to restart on each wrist raise. Now the app stays as the main app so its in the foreground of all other apps but still not infront of the user. When the Watch wakes up, the app at the foreground of the other apps appears, thats really it. Basically by setting HKWorkoutSession, you are saying keep my app on the foreground of the app stcks.


Unfortunatley NO 3rd-party apps will run any code in the background, and or be able to provide any haptic feebdack or any other background tasking. This is horrible and I worked hard to work around this. I really hope Apple reconsiders its choice especially because its own apps allow it and in my opinion thats anti-competitive.

Are you able to tell us or show us how you got around it?

I've an app which needs to give haptics to the user when their arm may be by their side!


EDIT: Or are you saying that you haven't got around it but was working hard to try?

This is a horrible experience! I need to be able to send the heart rate from the watch to the parent app on the iphone and the watch app just stops receiving the data from the healthkit as soon as the watch locks! Does anybody know how to resolve this?