Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 4.07 KB

gizo-gps-setting.md

File metadata and controls

50 lines (37 loc) · 4.07 KB
coverY
0

GIZO GPS Setting

GIZO GPS Setting

Overview

The GPS settings in GIZO SDK allow developers to incorporate GPS functionality into their iOS applications. This documentation provides instructions on enabling GPS, accessing location, speed, direction of movement (heading), and speed limit.

GizoGpsSetting can be used to customize the behavior an app by adjusting its reading and saving parameters.

For this reason, add the following block of code in the Application class, onCreate function, inside Gizo.initialize to set the GizoGpsSetting.

Note: We need to get MAPBOX_PUBLIC_KEY from Mapbox.

{% tabs %} {% tab title="Swift" %}

let options: GizoAppOptions = GizoAppOptions()
options.gpsSetting.allowGps = true
options.gpsSetting.mapBoxKey = "MAPBOX_PUBLIC_KEY"
options.gpsSetting.interval = 1000
options.gpsSetting.maxWaitTime = 1000
options.gpsSetting.withForegroundService = false
options.gpsSetting.saveCsvFile = true
options.gpsSetting.fileLocation = FileLocationPath.Cache
options.gpsSetting.saveDataTimerPeriod = 10

{% endtab %} {% endtabs %}

The GizoGpsSetting sets the GPS-related properties such as

  • allowGps(true): Enabling GPS.
  • mapBoxKey("MAPBOX_PUBLIC_KEY"): Providing the Mapbox API key for accessing Mapbox services.
  • interval(1000L): Default interval between location updates which updates to 1000 milliseconds (1 second) here.
  • maxWaitTime(1000L): Sets the maximum wait time in milliseconds for location updates. Locations are determined at intervals but delivered in batch based on wait time. Batching is not supported by all engines.
  • withForegroundService(true): If you set withForegroundService to true, you should only invoke this method when the app is in the foreground. withForegroundService - Boolean, if set to false, foreground service will not be started, no notifications will be rendered, and no location updates will be available while the app is in the background.
  • saveCsvFile(true): Indicating that the GPS data should be saved to a CSV file.
  • fileLocation(FileLocationPath.CACHE): Specifying the file location path for storing the GPS data CSV file (in this case, set to the cache directory).
  • saveDataTimerPeriod(10L): Setting the period of saving GPS data to 10 milliseconds.

This code suggests that the GizoAppOptions class provides a way to specify various configuration options for the GIZO application, including GPS-related settings. The specific implementation and usage of GizoAppOptions would depend on the details of the GIZO application itself.

​Here are the available options that can be set in gpsSetting in the Application class:

OptionsDefault ValueDescription
allowGps(Boolean)falseTo allow access to GPS setting.
mapBoxKey(String)_____The key was obtained from Mapbox.
interval(Long)1000LDefault interval between location updates.
maxWaitTime(Long)1000LSets the maximum wait time in milliseconds for location updates. Locations are determined at intervals but delivered in batch based on wait time. Batching is not supported by all engines.
withForegroundService(Boolean)trueIf set to true, foreground service will be started, notifications will be rendered, and location updates will be available while the app is in the background.
saveCsvFile(Boolean)falseTo save CSV file or not.
fileLocation(FileLocationPath)FileLocationPath.CACHETo save GPS file, in the CACHE or DOWNLOAD.
saveDataTimerPeriod(Long)10LThe period of time that a GPS data row is saved in CSV file.