razvan
razvan

Reputation: 535

Motion & Fitness on iPhone 5/5C

From what I know iPhone 5/5C do not have the motion processor like 5S and newer phones have, but when I request the motion permission the default alert with Allow and Don't allow still appears, even if I check before if the motion is available for device with MotionManager.isDeviceMotionAvailable. I would expect the alert not to appear for 5 and 5C.

What am I doing wrong here? Does 5 and 5C actually support motion?

Upvotes: 0

Views: 590

Answers (2)

razvan
razvan

Reputation: 535

As @the4kman said the device motion is available through accelerometer and a gyroscope.

But what I actually meant and needed in this case is the user's activity, which is available through the M7 processor that is installed on 5S and newer and to check if that is available on a device I did CMMotionActivityManager.isActivityAvailable()

Upvotes: 1

user3151675
user3151675

Reputation: 58149

No, you are getting this wrong; isDeviceMotionAvailable detects the presence of a gyroscope and an accelerometer. It's actually available since iOS 4, which came out way before the M7 motion coprocessor inside the iPhone 5s.

From Apple Documentation:

The device-motion service is available if a device has both an accelerometer and a gyroscope.

Upvotes: 1

Related Questions