Pointr Mobile SDK Manager’s Configuration¶
The managers available on the Mobile SDK have configuration parameters that can be set on Pointr Cloud or directly on the SDK during runtime. These parameters allow to control things like enabling/disabling bluetooth, location services, etc.
Note that any change performed on the SDK configuration during runtime is only valid during the current run. Next time the SDK is initialized, the previous runtime changes are no longer active. So in case you want to have permanent changes, these should be performed on Pointr Cloud. All runtime configuration changes should be performed while the SDK is on RUNNING
state and not before or after.
Changing configuration with Pointr Cloud¶
To set configurations parameters on Pointr Cloud you need to:
- Login to your Pointr Dashboard
- Select the client needed to be edited.
- Go to
Advanced Configuration
of the client. - Under
SDK
if the parameter you are looking for is not added,Add New
and add the parameter name, type and value. - At the end click on
Confirm
,Save
,Ready to Stage
andPublish
Changing configuration during runtime¶
After the SDK is RUNNING
it is possible to use the “Mutable” variants of configuration objects to change their parameter during runtime. Any modifications done will be lost after the application is closed and will need to be done again in the same way during runtime if needed.
The steps to change configuration during runtime are:
- Create an appropriate “Mutable Configuration” instance.
- Change only the values you wish changed on the instance created on step-1.
- Get the singleton instance of the configuration manager through the Pointr instance.
- Execute the updateRuntimeConfiguration method, with the mutable configuration instance as argument.
The Configuration Manager stores 3 sets of configurations, two of them can’t be modified. The only modifiable configuration is “Runtime Configuration”. The steps above merge the changes done with the “Mutable” configuration instance into the “Runtime Configuration”. This overrides the Runtime Configuration with only the parameters that were changed. All the values in Mutable Configuration objects are null by default, so only the edited parameters are merged into the current runtime configuration. This allows several calls to updateRuntimeConfiguration to merge them all, instead of one call erasing the work done in the previous calls.
Configuration classes and possible parameters¶
This Guide would be too cumbersome if all the possible classes that can be configured, and all their parameters were listed. The complete list can be found in the API Documentation.
- Pointr Android SDK list of Configuration Classes.
- Pointr iOS SDK list of Configuration Classes.
Examples¶
Disabling positioning¶
The Position Manager manages positioning, it has a related configuration class named Position Manager Configuration. The property isCoreLocationEnabled can be used to disable the Position Manager.
If postioning is disabled during runtime, the program will wait according to the configuration parameter beaconSilenceTimeInSeconds
, and after that the bluedot will disappear. The last location will also become invalid, returning something like -99999 instead of a real position.
Using Pointr Cloud:¶
- Parameter Name:
positionManagerConfiguration_isCoreLocationEnabled
- Type:
Boolean
- Value:
false
During runtime using Pointr SDK¶
val configuration = MutableConfiguration()
configuration.positionManagerConfiguration.isCoreLocationEnabled = false
Pointr.getPointr()?.configurationManager?.updateRuntimeConfiguration(configuration)
let configuration = PTRMutableConfiguration()
configuration.positionManagerConfiguration.isCoreLocationEnabled = false
Pointr.shared.configurationManager?.updateRuntimeConfiguration(configuration)
Disabling geofence events data uploads to Pointr Cloud¶
With the appropriate configuration class of the Geofence Manager it is possible to disable uploading to Pointr Cloud all the events generated when a user enters or exit a geofence.
Pointr Cloud:¶
- Parameter Name:
geofenceManagerConfiguration_shouldUploadGeofenceStateUpdates
- Type:
Boolean
- Value:
false
Mobile SDK¶
val configuration = MutableConfiguration()
configuration.geofenceManagerConfiguration.shouldUploadGeofenceStateUpdates = false
Pointr.getPointr()?.configurationManager?.updateRuntimeConfiguration(configuration)
let configuration = PTRMutableConfiguration()
configuration.geofenceManagerConfiguration.shouldUploadGeofenceStateUpdates = false
Pointr.shared.configurationManager?.updateRuntimeConfiguration(configuration)