Get CMMotionActivityManager updated when app is terminated

Viewed 418

Right now I'm developing an app that needs to know what the user is doing activity-wise (standing still, running, walking, ect.) all the time. I found that using CMMotionActivity might be a good way to do this.

Except for one thing: when the app is terminated, the CMMotionActivityManager stops running. First I tried to solve this by creating a cronjob to send remote silent notifications every n minutes and wake the app for motion data. I then did some research and found that silent notifications do not wake the app.

After some more research, I found that using Location and startMonitoringSignificantLocationChanges the app will be woken from a terminated state when the user moves 500 meters or more.

However, I believe I need more data then one point every 500 meters. Something more along the lines of one point every 5 minutes would be nice. But the sense I get is that startMonitoringSignificantLocationChanges won't update even if the user stands still for a whole day.

So my question in a nutshell is two parts:

  1. Am I misunderstanding startMonitoringSignificantLocationChanges? Will it give me a notification every so often even if the user doesn't move?

  2. If I don't misunderstand significant changes, is there any way to get Motion Updates every n minutes even when the app is terminated?

Thanks friends.

0 Answers
Related