Location Tracking

The Data Cloud Module for the Engagement Mobile SDK supports location tracking for all events. Enable this functionality using the setLocation method on the Data Cloud Module to set coordinates and expiresIn.

When the SDK has non-expired location coordinates, the location attributes are automatically appended to event attributes as key-value pairs with the key names latitude and longitude.

When the expiration interval is exceeded, the SDK location coordinates are cleared and no longer attached to events. To prevent location from being attached to events before the coordinates expire, call setLocation and pass nil values as the coordinates.

You’re responsible for handling location tracking permission from the customer, requesting location permission, fetching the location, and ensuring the desired accuracy range.