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
locationThe reference for fetching nearby places
-
Triggers
Place.ClientEventTypein a specific regionDeclaration
Swift
open func triggerClientEvent(in region: CLRegion, event: Place.ClientEventType)Parameters
regionRegion where the
Place.ClientEventTypewill be triggeredeventThe
Place.ClientEventTypethat 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
offersThe
[Offer]that will be sent within the notificationtitleTitle that will be displayed in the notification
fireDateIntervalTimeIntervalfor 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.ClientEventTypethat will be used inmakeMessagesForListDeclaration
Swift
open func getTitleFor(event: Place.ClientEventType, placeName: String) -> String
View on GitHub
GeofenceClientEventsManager Class Reference