Review the settings in the location section of CampaignConfig.json.
If the autoInitialize property in the location section is set to false, start location services and monitoring for locations by calling the manualLocationInitialization method.
Location module
Methods
(static) locationAuthorization()
This method reports if the app has authorization to use location services. It can report the following values:
-2 - the app has foreground only access to location services (use the manualLocationInitialization method)
-1 - the app is not authorized to use location services
0 - the app has not yet requested to use location services (use the manualLocationInitialization method)
1 - the app has complete access to location services
(static) manualLocationInitialization()
Use this method to manually initialize location services for the Campaign library. This lets you delay location services initialization until desired.
To enable the method, you must set the Auto initialize location feature to false in the CampaignConfig.json file.
(static) setLocationAuthorizationCallback()
This callback is called when access to the location services changes.
(static) setLocationUpdatedCallback(callback)
Set callback for location database updates.
Parameter
Type
Definition
callback
locationCallback
Callback which will be called when the database is updated.
(static) syncLocations()
Prompts the Campaign library to synchronize the geofences with the server. This can only be called once every 5 minutes.
Type definitions
locationCallback
The location callback includes no data. When it is received you should refresh your inbox database.