EagleBit is the most efficient way to get locations indefinitely without compromise battery life.
Is able to stop location updates when is not necessary and restart when the user moves again.
- Very low battery consumption (around 20%).
- Stop/restart location updates automatically.
- No config needed, defaults values are the best.
- Add CoreML to detect activity types and situations to reduce battery consumption.
- Add checks to prevent simulate location changes via Xcode or similar.
- Many more features
platform :ios, '10.0'
pod "EagleBit"
Add to mhergon/EagleBit
project to your Cartfile
github "mhergon/EagleBit"
Drag EagleBit.framework
from Carthage/Build/ to the “Linked Frameworks and Libraries” section of your Xcode project’s “General” settings.
Only on iOS/tvOS/watchOS: On your application targets "Build Phases" settings tab, click the "+" icon and choose "New Run Script Phase". Create a Run Script with the following contents:
/usr/local/bin/carthage copy-frameworks
and add the paths to the frameworks you want to use under "Input Files", e.g.:
$(SRCROOT)/Carthage/Build/iOS/EagleBit.framework
Download (right-click) and add to your project.
Version | Language | Minimum iOS Target |
---|---|---|
1.0 | Swift 4.x | iOS 10 |
First, import module:
import EagleBit
Authorize app to get location updates:
Eagle.authorize(level: .always) { (status) in
// Authorization status
}
Start location updates:
Eagle.fly { (location, error) in
/// Use location as you want!
}
If you want stop location updates manually, use:
Eagle.land()
You can set distanceFilter
and showsBackgroundLocationIndicator
(only iOS 11+) like this:
Eagle.distanceFilter = 10.0 // Meters
Eagle.showsBackgroundLocationIndicator = false // Hide blue bar on iOS 11
Licensed under Apache License v2.0.
Copyright 2017 Marc Hervera.