IGLocationManager Class Reference
Inherits from | NSObject |
---|---|
Declared in | IGLocationManager.h |
Overview
IGLocationManager is the central point for interacting with IngeoSDK. it provides configuration interface, activation methods and easy retriveal of location data. IGLocationManager does several (annoying) tasks for you:
- It handles the request for permission for location services from your users.
- It is configured for optimal usage and lowest battery consumption possible.
- It runs in background to constantly deliver you with accurate location updates.
- It provides you with the physical Motion State of your users (Standing, Walking, Driving slow or Driving fast).
- It filters out noise and inaccurate or irrelevant location updates.
- It resports anonymous location updates to Ingeo backend server to provide you with great Analytics Dashboard (can be disabled using
setIngeoBackendSupport:
).
Initialize and Setup
+ initWithDelegate:secretAPIKey:
Initializes and authenticates IGLocationManager with delegate and secret API key
+ (id)initWithDelegate:(id<IGLocationManagerDelegate>)delegate secretAPIKey:(NSString *)key
Parameters
delegate |
The delegate object to receive update events. |
---|---|
key |
The secret API key you recieved from Ingeo.io. |
Declared In
IGLocationManager.h
+ setIngeoBackendSupport:
Enable or disable Ingeo backend support.
+ (void)setIngeoBackendSupport:(BOOL)flag
Parameters
flag |
Boolean flag. |
---|
Discussion
Ingeo backend support is enabled by default, it provides seamless integration with Ingeo Analytics dashboard at http://admin.ingeo.io You may choose to completely disable all communication with Ingeo backend if you wish. By doing so you lose the following functionalities:
- Analytics dashboard for user statistics and smart marketing for your app.
- Offline location updates (location updates will not be queued on device while internet is unavailable).
Declared In
IGLocationManager.h
+ setUserId:
Set specific User ID
+ (void)setUserId:(NSString *)userId
Parameters
userId |
The User ID you wish to register. |
---|
Discussion
You may wish to register a specific user ID to be associated with the current user session, this could be your own app user ID’s or any other required identification you wish to provide.
Declared In
IGLocationManager.h
+ setCustomServerURL:
Set custom server URL for submitting location updates
+ (void)setCustomServerURL:(NSString *)url
Parameters
url |
The URL for submitting location updates |
---|
Discussion
You may wish to submit location updates to your own server. Your server should respond to POST requests on this URL containing the IGLocation object in JSON format. Note: Ingeo backend support gets disabled once a custom server URL is set.
Declared In
IGLocationManager.h
+ setCustomHTTPHeaders:
Set custom HTTP headers for location update POST requests
+ (void)setCustomHTTPHeaders:(NSDictionary *)headers
Parameters
headers |
A dictionary containing your custom HTTP headers |
---|
Discussion
If you choose to set a custom server URL for submitting location updates, you may also want to set custom HTTP headers (for authentication and such) with the outgoing location POST request. Simply provide a dictionary where keys represent the HTTP header names, and values represent the coresponding HTTP header values.
Declared In
IGLocationManager.h
Location Monitoring Activation and Deactivation
+ startUpdatingLocation
Starts the location monitoring service.
+ (void)startUpdatingLocation
Declared In
IGLocationManager.h
+ stopUpdatingLocation
Stops the location monitoring service.
+ (void)stopUpdatingLocation
Declared In
IGLocationManager.h
IGLocationManager Configuration Properties
+ delegate
Returns the IGLocationManagerDelegate protocol delegate.
+ (id<IGLocationManagerDelegate>)delegate
Declared In
IGLocationManager.h
+ secretAPIKey
Returns the IGLocationManagerDelegate secret API key.
+ (NSString *)secretAPIKey
Declared In
IGLocationManager.h
+ userId
Returns the User ID associated with the current session.
+ (NSString *)userId
Declared In
IGLocationManager.h
Retrieve Location Data
+ currentLocation
Returns a IGLocation object representing the latest location measurement taken by IngeoSDK.
+ (IGLocation *)currentLocation
Declared In
IGLocationManager.h
+ currentMotionState
Returns the current user’s Motion State.
+ (IGMotionState)currentMotionState
Declared In
IGLocationManager.h