Classes
The following classes are available globally.
-
Trckr Internal logging facility.
To enable Trckr logs, call
Log.start()
.By default, Trckr logs to the console and to a file. This can be disabled with
enableConsoleLog
andenableFileLog
respectively. The current log file can be accessed withlogFileName
.Log files are capped at 1MB and are rotated. When a log file is rotated, it is renamed and saved as archive. You can get the archived log file path via
See moredidRotateLogFile
closure.Declaration
Swift
public class Log : NSObject
-
A client for monitoring beacon regions.
Beacons are small devices that advertize their location by emitting a BLE (Bluetooth Low Energy) signal in 2.4Ghz frequency range. Beacons can be attached to stationary or moving objects which can then be detected and identified by Trckr.
The
Beacon
class provides methods for adding and removing beacon regions.You add a new beacon region with
See moreBeacon.addBeacon(proximityUUID:notify:identifier:)
. When that region is crossed - either exiting or entering that region -Beacon
client will callTrckrDelegate.didCross(region:type:withinSchedule:)
method.Declaration
Swift
public class Beacon : NSObject
-
A client for monitoring circular (geographic) regions.
A geographical region is an area defined by a circle of a specified radius around a known point on the Earth’s surface.
Geofence
class is used internally byTrckr
for monitoring when the user resumes movement. While the user is moving,Trckr
receives continuous location updates from CoreLocation. When the user stops moving, a geofence region is added withGeofence.RegionId
as its identifier and an.Exit
trigger. When the user exists the geofenced region, continuous location updates are resumed.In iOS, regions associated with your app are tracked at all times, including when the app isn’t running, and are very power efficient since the hardware required to monitor them is already used by other services - WiFi and Cellular signal. Monitoring geofence regions allows
Trckr
to track the user’s location even when your app isn’t running.You should not use
See moreGeofence
class directly.Declaration
Swift
public class Geofence : NSObject
-
Provides location tracking using a combination of:
- Continuous location updates (while the user is moving)
- Significant location changes (to sustain background operation)
- Region monitoring, using
Geofence
(when the user is stationary) Beacon
region monitoring (e.g. detecting vehicle used)
Usage:
// start tracking Trckr.sharedInstance.trackingEnabled = true // stop tracking Trckr.sharedInstance.trackingEnabled = false
When using Trckr, you must add the following entries to your app’s info.plist:
- NSMotionUsageDescription
- NSLocationAlwaysAndWhenInUseUsageDescription
- NSLocationAlwaysUsageDescription
- NSLocationWhenInUseUsageDescription
- UIBackgroundModes: location
Declaration
Swift
public class Trckr : NSObject, CLLocationManagerDelegate