GeofenceClientEventsManager

open class GeofenceClientEventsManager : NSObject, GeofenceClientEvents

A class conforming to GeofenceClientEvents protocol that serves as a predefined handler for geofence events

  • Creates regions that are based from the nearby places of the given location

    Declaration

    Swift

    open func createClientEventRegions(for location: CLLocation)

    Parameters

    location

    The reference for fetching nearby places

  • Triggers Place.ClientEventType in a specific region

    Declaration

    Swift

    open func triggerClientEvent(in region: CLRegion, event: Place.ClientEventType)

    Parameters

    region

    Region where the Place.ClientEventType will be triggered

    event

    The Place.ClientEventType that will be triggered

  • Initiates a notification request

    Declaration

    Swift

    public func sendLocalNotification(for offers: [Offer],
                                      withTitle title: String,
                                      andInterval fireDateInterval: TimeInterval,
                                      completion: ((Error?) -> Void)?)

    Parameters

    offers

    The [Offer] that will be sent within the notification

    title

    Title that will be displayed in the notification

    fireDateInterval

    TimeInterval for when the notification will be triggered

  • Forms the necessary parameters using the given location for fetching nearby places

    Declaration

    Swift

    open func formParamsForNearbyPlaces(using location: CLLocation) -> Parameters
    • Computes the radius of the given place by multiplying its distance to 1609 then adding its radius.
    • Or if the the given place is nil, this returns the product of the given radius and 1609

    Declaration

    Swift

    open func computeRadius(placeDistance: Double?, placeRadius: Double?, defaultRadius: Int) -> Double
  • Returns the localized title string for a given Place.ClientEventType that will be used in makeMessagesForList

    Declaration

    Swift

    open func getTitleFor(event: Place.ClientEventType, placeName: String) -> String