Smartech

Location Tracking

Smartech SDK automatically tracks the location of the user unless you have set NO as the value for the key SmartechAutoFetchLocation in your apps Info.plist under SmartechKeys dictionary.

If the application is already tracking the location and you would want Smartech to use that value, then register the location with the SDK by calling setUserLocation.

CLLocationCoordinate2D location = CLLocationCoordinate2DMake(latitude, longitude);
[[Smartech sharedInstance] setUserLocation:location];
let location = CLLocationCoordinate2DMake(latitude, longitude)
Smartech.sharedInstance().setUserLocation(location)
SmartechSDK.setUserLocation(LATITUDE_DOUBLE_VALUE,  LONGITUDE_DOUBLE_VALUE);

// Sample code for reference purpose only
SmartechSDK.setUserLocation(19.0760, 72.8777);

The location collected, either explicitly or implicitly, will be sent to Smartech servers with every Smartech SDK event. We will continue to send the same location value to our server until it changes.

This location value is maintained in-memory and get's flushed on every app launch. If the app is setting the value of the location manually then it's recommended to set the new value as soon as the app is launched. If the value is not set Smartech SDK will send the blank value to Smartech server.

If SmartechAutoFetchLocation is YES then the value will be automatically updated on app launch.

Updated 6 months ago


Next

You can choose to go back

User & Event Tracking

Location Tracking


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.