I am using the following code from the Privacy Prompts project to get the Motion Permission.
- (void)requestMotionAccessData {
self.cmManager = [[CMMotionActivityManager alloc] init];
self.motionActivityQueue = [[NSOperationQueue alloc] init];
[self.cmManager startActivityUpdatesToQueue:self.motionActivityQueue withHandler:^(CMMotionActivity *activity) {
/*
* Do something with the activity reported
*/
NSLog(@"requestMotionAccessData");
[self alertViewWithDataClass:Motion status:NSLocalizedString(@"ALLOWED", @"")];
[self.cmManager stopActivityUpdates];
}];
}
What if user not allow the motion permission. Do i get some callback?
If not is there an alternative way to get the this. I want the callback when user selects Allow
or Don't Allow