Marcus Blankenship
Marcus Blankenship

Reputation: 521

Building Pedometer with Core Motion

I'd like to build a pedometer which runs in the background on iOS5 devices. I understand the Core Motion framework can be used to accomplish this, like Nike+ is doing with their pedometer app.

I've also heard that there are restrictions on when Core Motion can be used in the background, specifically the OReilly's iOS 5 book says, "In iOS5 Core Motion is legal while your app is running in the background. To take advantage of this your app would need to be running in the background for some other reason."

This seems strange to me. Does this mean I have to have an "excuse" to use Core Motion in the background?

Upvotes: 1

Views: 2628

Answers (2)

Timothy Tripp
Timothy Tripp

Reputation: 3287

Just make it location aware. Log the pedometer activity and the GPS location.

Upvotes: 1

Jeff Wolski
Jeff Wolski

Reputation: 6372

Yes, in order to run your app in the background, your app has to be in one of a few blessed categories: music, location, VOIP.

EDIT:

You can find the docs here: https://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CoreData/Articles/cdRelationships.html

Upvotes: 1

Related Questions