I'm using startDeviceMotionUpdates
for my apple watch app, and it is not working. Following is my code:
import WatchConnectivity
import CoreMotion
class ResultInterfaceController: WKInterfaceController, WCSessionDelegate {
var deviceQueue = OperationQueue()
var motionManager = CMMotionManager()
override func awake(withContext context: Any?) {
super.awake(withContext: context)
self.motionManager.deviceMotionUpdateInterval = 0.5
motionManager.startDeviceMotionUpdates(to: deviceQueue) { deviceManager, error in
print("Success")
}
print(motionManager.isDeviceMotionActive) // returns false
}
}
Output is: false
I am unable to identify the issue. Please help