I was wondering if anyone can point me in the right direction with regard to utilzing the M7 chip in the iPhone5S and above.
I was wondering if it's just automagically used when you use general core motion APIs or is there a specific set of APIs to use?
Finally I noted whilst reading some articles online that it keeps some historical movement data, anyone know how to access this or can anyone point me in the right direction?
The two main classes you're looking for are
CMMotionActivityManager
andCMMotionActivity
. The first lets you query historical data and manage motion in general. The second gives you access to different, more specific types of motion.These two classes are available only on iOS 7. Use
-[CMMotionActivityManager isActivityAvailable]
to determine if motion is available first. I have not found any documentation on it, but my guess is that method will only returnYES
on devices that have the M7 chip (or future chips that support motion activity reporting).If you are looking for historical data it might be valuable to look into this specific function: queryStepCountStartingFrom:to:toQueue:withHandler: Its part of CMStepCounter which is only available on phones with the M7. From the docs:
Hopefully this helps!