Skip to content

Position and Geofence Configurations

The following table lists the configuration parameters and their default values that are used to configure the foreground and background behavior of Pointr SDK’s GPS, geofence, and beacon tracking capabilities in iOS and Android.

SDK Property Default Pointr Cloud Parameter Name Platform
isCoreLocationEnabled true positionManagerConfiguration_isCoreLocationEnabled iOS
isEnabled true positionManagerConfiguration_isEnabled Android
isBackgroundPositioningEnabled false positionManagerConfiguration_isBackgroundPositioningEnabled iOS/Andoid
isGpsTrackingEnabledInForeground true positionManagerConfiguration_isGpsTrackingEnabledInForeground iOS/Andoid
isGpsTrackingEnabledInBackground false positionManagerConfiguration_isGpsTrackingEnabledInBackground iOS/Andoid
isGlobalGeofencingEnabled true geofenceManagerConfiguration_isGlobalGeofencingEnabled iOS/Andoid
isLevelGeofencingEnabled true geofenceManagerConfiguration_isLevelGeofencingEnabled iOS/Andoid

With the default values, Pointr SDK is configured to receive GPS location updates and geofence events, and range beacons when the app is in foreground but not in background. In Android, Bluetooth tracking is also enabled by default.

You can set these parameters in Pointr Cloud using the names listed in the last column to override their default values and obtain the following Pointr SDK behaviors:

No GPS, Geofence, or Beacon Tracking

For iOS,

Pointr Cloud Parameter Name Value
positionManagerConfiguration_isCoreLocationEnabled false

For Android,

Pointr Cloud Parameter Name Value
positionManagerConfiguration_isEnabled false

Only GPS and Beacon Tracking in Foreground

Pointr Cloud Parameter Name Value
geofenceManagerConfiguration_isGlobalGeofencingEnabled false
geofenceManagerConfiguration_isLevelGeofencingEnabled false

Only GPS and Beacon Tracking in Background

Pointr Cloud Parameter Name Value
positionManagerConfiguration_isBackgroundPositioningEnabled true
positionManagerConfiguration_isGpsTrackingEnabledInForeground false
positionManagerConfiguration_isGpsTrackingEnabledInBackground true
geofenceManagerConfiguration_isGlobalGeofencingEnabled false
geofenceManagerConfiguration_isLevelGeofencingEnabled false

Only GPS and Beacon Tracking in Both Foreground and Background

Pointr Cloud Parameter Name Value
positionManagerConfiguration_isBackgroundPositioningEnabled true
positionManagerConfiguration_isGpsTrackingEnabledInBackground true
geofenceManagerConfiguration_isGlobalGeofencingEnabled false
geofenceManagerConfiguration_isLevelGeofencingEnabled false

GPS, Geofence, and Beacon Tracking in both Foreground and Background

Pointr Cloud Parameter Name Value
positionManagerConfiguration_isBackgroundPositioningEnabled true
positionManagerConfiguration_isGpsTrackingEnabledInBackground true

GPS, Geofence and Beacon Tracking Only in Background

Pointr Cloud Parameter Name Value
positionManagerConfiguration_isBackgroundPositioningEnabled true
positionManagerConfiguration_isGpsTrackingEnabledInBackground true
positionManagerConfiguration_isGpsTrackingEnabledInForeground false

Only Beacon Tracking in Foreground

Pointr Cloud Parameter Name Value
positionManagerConfiguration_isGpsTrackingEnabledInForeground false
geofenceManagerConfiguration_isGlobalGeofencingEnabled false
geofenceManagerConfiguration_isLevelGeofencingEnabled false

No Level Geofence Tracking

Pointr Cloud Parameter Name Value
geofenceManagerConfiguration_isLevelGeofencingEnabled false

NOTE: Geofence tracking requires GPS tracking to be enabled, therefore there are no cases for only Geofence tracking.

Accessing config parameters from code

You can access the current values of these parameters from your code via:

//access position manager configuration
val positionManagerConfig = Pointr.getPointr()?.configurationManager?.globalConfiguration?.positionManagerConfiguration
// access geofence manager configuration
val geofenceManagerConfig = Pointr.getPointr()?.configurationManager?.globalConfiguration?.geofenceManagerConfiguration

//use their properties
print(positionManagerConfig.isCoreLocationEnabled)
print(positionManagerConfig.isBackgroundPositioningEnabled)
print(positionManagerConfig.isGpsTrackingEnabledInForeground)
print(positionManagerConfig.isGpsTrackingEnabledInBackground)
print(geofenceManagerConfig.isGlobalGeofencingEnabled)
print(geofenceManagerConfig.isLevelGeofencingEnabled)
//access position manager configuration
let positionManagerConfig = Pointr.shared.configurationManager?.globalConfiguration.positionManagerConfiguration
//access geofence manager configuration
let geofenceManagerConfig = Pointr.shared.configurationManager?.globalConfiguration.geofenceManagerConfiguration

//use their properties
print(positionManagerConfig.isCoreLocationEnabled)
print(positionManagerConfig.isBackgroundPositioningEnabled)
print(positionManagerConfig.isGpsTrackingEnabledInForeground)
print(positionManagerConfig.isGpsTrackingEnabledInBackground)
print(geofenceManagerConfig.isGlobalGeofencingEnabled)
print(geofenceManagerConfig.isLevelGeofencingEnabled)

Updating config parameters during runtime

You can modify the configuration parameters set via Pointr Cloud during runtime as described in our Configuration guide.


Last update: July 12, 2023
Back to top