SPGeofence
Objective-C
@interface SPGeofence : SPGeofenceInfo
Swift
class SPGeofence : SPGeofenceInfo
Extends SPGeofenceInfo with some more common information required by geofences. Does not contain geometry information.
-
Sets time when geofence should expire and disappear. By default geofences disappear when application is restarted.
Declaration
Objective-C
- (void)setExpirationDate:(nonnull NSDate *)date;
Swift
func setExpirationDate(_ date: Date)
Parameters
date
expiration date for geofence
-
Time delay after a ‘dwell’ transition should happen after entry/exit to geofence.
Declaration
Objective-C
- (void)setLoiteringDelay:(NSTimeInterval)seconds;
Swift
func setLoiteringDelay(_ seconds: TimeInterval)
Parameters
seconds
amount of seconds after a ‘dwell’ event will be triggered.
-
Set which types of transition callbacks you want to receive from the geofence. Enter and exit notifications are enabled by default.
Declaration
Objective-C
- (void)setTransitionTypes:(SPGeofenceTransitionOptions)transitions;
Swift
func setTransitionTypes(_ transitions: SPGeofenceTransitionOptions)
Parameters
transitions
types of transitions that geofence should listen to.
-
Declaration
Objective-C
- (SPGeofenceTransitionOptions)transitions;
Swift
func transitions() -> SPGeofenceTransitionOptions
Return Value
transition types for geofence.
-
Declaration
Objective-C
- (NSTimeInterval)loiteringDelay;
Swift
func loiteringDelay() -> TimeInterval
Return Value
time delay between before triggering ‘dwell’ type transitions
-
Declaration
Objective-C
- (NSTimeInterval)expirationTime;
Swift
func expirationTime() -> TimeInterval
Return Value
utc timestamp when geofence will disappear