Reputation: 5099
Is there a way to detect activity in the background using my app like Apple does it?
Currently there's no way to calculate stairs climbed by the user while using a stair stepper machine using the Apple Watch/iPhone. We want to be able to detect activity in the background if our app is installed and ask them "It looks like your climbing stairs on a stair stepper". The only thing I can think of is to do a Background scheduler event, but the shortest period allowable is every 15 minutes which is almost at the end of any work out with a stair stepper machine.
Is the Apple Watch using inaccessible private APIs to achieve this behavior? Or is there a way we can achieve it too?
Upvotes: 0
Views: 444
Reputation: 29464
I have never tried it but I think it can be done with location region monitoring and some ML.
Keep track of where the user is when they trigger workouts, and the time. Maybe even heart rate and any other data that might give you clues.
When you get notified that the user is in that spot, check for activity and/or clues with ML and send the notification.
The watch only seems to send that notification if it knows the area where you are is a workout area and the right time.
Apple has ML videos where the user can train a model on device. I think their sample shows a restaurants app where depending on time, day, and location you can suggests restaurants to a user.
Upvotes: 1