Skip to content

Commit

Permalink
(iOS): If motion tracking is not available on the device, return "not…
Browse files Browse the repository at this point in the history
… available" when calling getMotionAuthorizationStatus(). Further resolves #372.
  • Loading branch information
Dave Alden committed Oct 1, 2019
1 parent c4750d1 commit 913b2e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ios/Diagnostic_Motion.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ - (void) isMotionRequestOutcomeAvailable:(CDVInvokedUrlCommand *)command
- (void) getMotionAuthorizationStatus: (CDVInvokedUrlCommand*)command
{
[self.commandDelegate runInBackground:^{
if([diagnostic getSetting:@"motion_permission_requested"] == nil){
if(![self isMotionAvailable]){
// Activity tracking not available on this device
[diagnostic sendPluginResultString:@"not_available":command];
}else if([diagnostic getSetting:@"motion_permission_requested"] == nil){
// Permission not yet requested
[diagnostic sendPluginResultString:@"not_requested":command];
}else{
Expand Down

0 comments on commit 913b2e4

Please sign in to comment.