Yes! We provide a listener/delegate that developers can use to be notified on geofence enter/exit. You could store the last-visited Place information clientside and use it within your app to provide a store-specific experience.
For geofence enter/exit events, call
/** * Add a listener that will be notified of certain location callbacks. * @param listener The object that will receive the callbacks. Pass in null * to remove an existing listener. */ public static void setLocationListener(@Nullable LocationListener listener)
Your LocationListener can provide a callback for region (geofence) enter and exit:
/** * Callback for when regions have been triggered with a particular event */ void localyticsDidTriggerRegions(@NonNull List<Region> regions, @NonNull Region.Event event);
Localytics.LLLocationDelegate is a protocol which defines methods to be called when geofences are triggered or updated. When you have implemented your delegate, call
[Localytics setLocationDelegate: delegate] after Localytics initialization to hook in your custom logic to perform additional actions on geofence triggering.
This delegate can include the method
- (void)localyticsDidTriggerRegions:(nonnull NSArray<LLRegion *> *)regions withEvent:(LLRegionEvent)event;
The regions included in the listener/delegate include the identifier as well as any extra attributes associated with the regions that were triggered, and the event indicates whether it was an enter or exit event.