We could also build a travel app that defaults to an on-trip mode when the user is in an airport, a real estate app that defaults to a self-tour mode when the user is at a home, and so on.
If you haven't already, sign up for Radar to get your API key. You can create up to 1,000 geofences and make up to 100,000 API requests per month for free.Get API Keys
On the Geofences page, import geofences for RadarMart locations.
The CSV should include 8 columns:
description: A display name for the geofence. In this case, the store name.
tag: A group for the geofence. In this case,
externalId: An external ID for the geofence that maps to your internal database. In this case, the store ID.
type: The type of geofence geometry. In this case,
radius: The radius in meters for type circle. In this case,
coordinates: A JSON string representing a center in the format [longitude,latitude] for type circle. Note that longitude comes before latitude, a GeoJSON convention.
enabled: In this case,
metadata: A set of custom key-value pairs for the geofence. A JSON string representing a dictionary with up to 16 keys and values of type string, boolean, or number. In this case,
Initialize the SDK in your
AppDelegate class with your publishable API key.
Radar.trackOnce() to track the user's location in the foreground. In the callback, check
user.geofences to determine if the user is in a geofence, then show a message and default to the in-store tab.
Have questions or feedback on this documentation? Let us know! Email us at [email protected].