Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS9 Background Location Support #24

Closed
johnnyshankman opened this issue Nov 24, 2015 · 1 comment
Closed

iOS9 Background Location Support #24

johnnyshankman opened this issue Nov 24, 2015 · 1 comment

Comments

@johnnyshankman
Copy link

Currently we cannot do background location updates with SOMotionDetector on iOS9

We have to expose a way to set the allowsBackgroundLocationUpdates property of the SOLocationManager's instance of CLLocationManager to YES or NO.

https://developer.apple.com/library/prerelease/ios/releasenotes/General/iOS90APIDiffs/Objective-C/CoreLocation.html

https://developer.apple.com/library/prerelease/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html#//apple_ref/occ/instp/CLLocationManager/allowsBackgroundLocationUpdates

@johnnyshankman
Copy link
Author

I currently do this to get around it. Maybe I'll make a pull request.

In SOMotionDetector:

- (void)updateLocationInBackgroundMode {
    [[SOLocationManager sharedInstance] setBackgroundUpdates: true];
}

In SOLocationManager:

- (void)setBackgroundUpdates:(bool)shouldUpdate {
    self.locationManager.allowsBackgroundLocationUpdates = shouldUpdate;
}

That way the dev makes once call to [[SOMotionDetector sharedInstance] updateLocationInBackgroundMode]] before starting updates and they are good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants