IngeoSDK for iOS
Overview
IngeoSDK is a power-efficient location manager for iOS (Swift and Objective-C), which extends and improves CoreLocation.
It uses unique algorithms to dynamically and constantly adjust CoreLocation's tracking configuration parameters according to user's motion, behavior, speed and whereabouts. Thus enabling suited configuration scheme for optimized accuracy and minimum power consumption in real-time.
Your app and/or server will receive the most relevant location data while in foreground or background - even when network is disconnected. Off-course, or bad location samples are filtered out for you. Battery consumption is just ~2% per hour.
Supports iPhone, iPad, iPod Touch running iOS 7.0+
For a full list of features visit: http://ingeo.io/sdk
Demo, please?
-
Download as zip file or clone this repository.
-
Unzip and open the project file in Samples/Swift-Sample01 directory using Xcode.
-
Edit ViewController.swift to enter your API key in the initializer method:
IGLocationManager.initWithDelegate(self, secretAPIKey: "APIKEYGOESHERE")
To get a new API key, Signup for free.
-
Now simply run in iOS Simulator or your device and watch the debug console as the demo app takes you traveling through San Fransisco streets (using a recorded GPX file).
Installing with CocoaPods
-
Add the following line to your Podfile:
pod 'IngeoSDK'
-
Run:
pod install
Enable Location Services
-
In Xcode, Go to your target settings -> 'Capabilities' -> 'Background Modes'
Turn on 'Location updates'. -
Edit your app's Info.plist and add the following String key (with empty value):
NSLocationAlwaysUsageDescription
Usage
-
Import
import IngeoSDK
-
Set Delegate
class ViewController: UIViewController, IGLocationManagerDelegate {
-
Initialize
IGLocationManager.initWithDelegate(self, secretAPIKey: "APIKEYGOESHERE")
-
Start Location Monitoring
IGLocationManager.startUpdatingLocationAlwaysOn()
Or
IGLocationManager.startUpdatingLocationWhenInUse()
-
Get the honey
Implement IGLocationManagerDelegate methods in your delegate.Swift:
func igLocationManager(manager: IGLocationManager!, didUpdateLocation igLocation: IGLocation!) { print("didUpdateLocation: \(igLocation.description)") } func igLocationManager(manager: IGLocationManager!, didDetectMotionState motionState: IGMotionState) { print("didDetectMotionState: \(IGLocation.stringForMotionState(motionState))") }
Objective-C:
- (void)igLocationManager:(IGLocationManager *)manager didUpdateLocation:(IGLocation *)igLocation { NSLog(@"didUpdateLocation: %@", [igLocation description]); } - (void)igLocationManager:(IGLocationManager *)manager didDetectMotionState:(IGMotionState)motionState { NSLog(@"didDetectMotionState: %@",[IGLocation stringForMotionState:motionState]); }
-
That's it. you've just enabled constant location monitoring.
Sit and watch your users on the Admin Dashboard http://admin.ingeo.io.
API Documentation
Full API reference: http://ingeo.io/sdk/docs
License
Apache v2.0
Feedback
Feel free to contact us at [email protected] or open an issue here.