Skip to main content

CoPilotMgr (React Native)

Contents

Note: All React Native methods are async functions.

CopilotMgr

Overview
DescriptionA class containing static methods for setting and checking various CoPilot features and settings.
Supported on React Native Since Version10.14

Methods

Method NameReturn TypeDescription
getUnitsOfMeasure() (Android only)
UnitsofMeasure
Gets the UnitsOfMeasure displayed by CoPilot.
setUnitsOfMeasure(int) (Android only)
void
Sets the UnitsOfMeasure displayed by CoPilot.
getVersionInfo()
CopilotVersion
Returns a CopilotVersion object containing information about CoPilot’s application version number and map data version.
enableGPS() (Android only)
void
Restarts the CoPilot GPS Service and resumes all suspended GPS activities including listening, and processing.
disableGPS() (Android only)
void
Suspends background GPS/routing processing and deregister the CoPilot GPS Service. Background Navigation will not work after this API call.
setTurnInstructionCallbackDelay(int)
Available in CoPilot 10.26.1.300 and Later
void
Sets the time between when turn instruction callbacks onReadyToSpeakTurnInstruction and onSpeakTurnInstructionComplete are fired when CoPilot starts speaking.
getTurnInstructionCallbackDelay()
Available in CoPilot 10.26.1.300 and Later
Int
Retrieves the current delay between when the turn instruction callbacks onReadyToSpeakTurnInstruction and onSpeakTurnInstructionComplete.

Motion Lock

Motion Lock is a safety feature within CoPilot that limits a driver’s access to the CoPilot UI while traveling above a threshold speed.

CoPilotMgr.setMotionLockMode

Overview
DescriptionMotion Lock will lock the CoPilot UI once traveling above a specified speed. The UI can be locked down over a different range of modes, restricting more or less of the UI based on integration needs.

The threshold at which Motion Lock will be initiated should be set using setMotionLockSpeedThreshold. This API is just to set the lock mode, it’s not responsible for the actual lock to be activated.

Supported on React Native Since Version10.14
TypeMethod

Syntax

void setMotionLockMode(motionLockMode)

Parameters

motionLockMode - The mode that you want CoPilot to lock down once motion lock has been initiated. This will dictate the available options once traveling above the specified threshold speed.

Return

None

Sample Code

const CopilotMgr = NativeModules.CopilotMgr;
const MotionLockMode = NativeModules.MotionLockMode;

CopilotMgr.setMotionLockMode(MotionLockMode.ALL_UI_LOCK);

CopilotMgr.getMotionLockMode

Overview
DescriptionReturns the current Motion Lock mode. The mode dictates the extent to which the CoPilot UI will be locked down once initiated and traveling above the threshold speed. This will not return the threshold speed.
Supported on React Native Since Version10.14
TypeMethod

Syntax

constant getMotionLockMode()

Parameters

None

Return Values

MotionLockMode

Sample Code

const CopilotMgr = NativeModules.CopilotMgr;
var mode = await CopilotMgr.getMotionLockMode();

CopilotMgr.getMotionLockSpeedThreshold

Overview
DescriptionReturns the current speed threshold at which Motion Lock will be enabled. Motion Lock will lock the CoPilot navigation screen, preventing user input, when the vehicle’s speed reaches this threshold.
Supported on React Native Since Version10.14
TypeMethod

Syntax

constant getMotionLockSpeedThreshold()

Parameters

None

Return Value

MotionLockSpeedThreshold - The speed above which Motion Lock is active.

Sample Code

const CopilotMgr = NativeModules.CopilotMgr;
var speed = await CopilotMgr.getMotionLockSpeedThreshold();

CopilotMgr.setMotionLockSpeedThreshold

Overview
DescriptionSets the threshold (in mph) for enabling and disabling Motion Lock. Motion Lock prevents user interaction with CoPilot while driving at or above a specified speed threshold.
The values for this API can be found in setMotionLockSpeedThreshold.
Supported on React Native Since Version10.14
TypeMethod

Syntax

void setMotionLockSpeedThreshold(motionLockSpeedThreshold)

Parameters

motionLockSpeedThreshold - The speed above which Motion Lock is active.

Return Values

None

Sample Code

const CopilotMgr = NativeModules.CopilotMgr;
const MotionLockSpeedThreshold = NativeModules.MotionLockSpeedThreshold;

CopilotMgr.setMotionLockSpeedThreshold(MotionLockSpeedThreshold.LEVEL_2);

CopilotMgr.getUnitsOfMeasure

Overview
DescriptionReturns the measurement type currently set within CoPilot, metric or imperial. Units of Measurement are used for functions including speed, distance and vehicle dimensions.
Supported on React Native Since Version10.14
TypeMethod
MeasureMetricImperial
SpeedKilometers per Hour (KPH)Miles per Hour (MPH)
DistanceKilometers, Meters, CentimetersMiles, Feet, Inches
Vehicle DimensionsMeters, Centimeters, TonFeet, Inches, Ton, 000’s Pounds (US)

Syntax

constant getUnitsOfMeasure()

Parameters

None

Return Value

UnitsOfMeasure - Either METRIC or IMPERIAL units.

Sample Code

const CopilotMgr = NativeModules.CopilotMgr;
var unit = await CopilotMgr.getUnitsOfMeasure();

CopilotMgr.setUnitsOfMeasure

Overview
DescriptionSets whether metric or imperial values should be used within CoPilot. Units of Measurement are used for functions including speed, distance and vehicle dimensions.
Supported on React Native Since Version10.14
TypeMethod
MeasureMetricImperial
SpeedKilometers per Hour (KPH)Miles per Hour (MPH)
DistanceKilometers, Meters, CentimetersMiles, Feet, Inches
Vehicle DimensionsMeters, Centimeters, TonFeet, Inches, Ton, 000’s Pounds (US)

Syntax

void setUnitsOfMeasure(unitsOfMeasure)

Parameters

unitsOfMeasure - Either METRIC or IMPERIAL units.

Return Value

None

Sample Code

const CopilotMgr = NativeModules.CopilotMgr;
const UnitsOfMeasure = NativeModules.UnitsOfMeasure;

CopilotMgr.setUnitsOfMeasure(UnitsOfMeasure.METRIC);

CopilotMgr.getVersionInfo

Overview
DescriptionReturns a JSON object (copilotversion), which includes details of the currently installed CoPilot application version number as well as the map data release (year and quarter).
Supported on React Native Since Version10.14
TypeMethod

Syntax

JSONObject getVersionInfo()

Parameters

None

Return Value

A CopilotVersion JSON object containing information about the version of the CoPilot application and map data.

Sample Code

const CopilotMgr = NativeModules.CopilotMgr;
var cpVersion = await CopilotMgr.getVersionInfo();

CopilotMgr.enableGPS

Overview
DescriptionRestarts the CoPilot GPS Service and resumes all suspended activities following the API call CopilotMgr.disableGPS() . CoPilot will register with the GPS receiver to initiate listening and processing the current position again.
Supported on React Native Since Version10.14
TypeMethod

Syntax

void enableGPS()

Parameters

None

Return Value

void

Sample Code

const CopilotMgr = NativeModules.CopilotMgr;
CopilotMgr.enableGPS();

CopilotMgr.disableGPS

Overview
DescriptionAttempts to minimize CPU usage by suspending background GPS/routing processing and unregistering the CoPilot GPS Service. Background navigation will not work after this API call; this will mean that your application cannot retrieve updated ETA or distance information.
Supported on React Native Since Version10.14
TypeMethod

Syntax

void disableGPS()

Parameters

None

Return Value

void

Sample Code

const CopilotMgr = NativeModules.CopilotMgr;
CopilotMgr.disableGPS();

CopilotMgr.setConfigurationSetting

Overview
DescriptionApplies a setting specified by the given ConfigurationSetting object.
Supported on React Native Since Version10.14
TypeMethod

Syntax

void setConfigurationSetting(configurationSetting)

Parameters

A JSON Object that has key in ConfigurationName and value in ConfigurationValue

Sample Code

const CopilotMgr = NativeModules.CopilotMgr;
const ConfigurationName = NativeModules.ConfigurationName;
const ConfigurationValue = NativeModules.ConfigurationValue;

var configSetting = {};
configSetting.name = ConfigurationName.CHEVRON_DISPLAY;
configSetting.value = ConfigurationValue.CHEVRON_DISPLAY_LAT_LON;
CopilotMgr.setConfigurationSetting(configSetting);

CopilotMgr.getConfigurationSetting

Overview
DescriptionGet the current settings for the given configuration.
Supported on React Native Since Version10.14
TypeMethod

Syntax

JSONObject getConfigurationSetting(configurationName)

Parameters

configurationName - The configuration name for which to retrieve the current settings.

Return Value

A JSON object representing the current setting for the given configuration.

Sample Code

const CopilotMgr = NativeModules.CopilotMgr;
const ConfigurationName = NativeModules.ConfigurationName;

var config = await CopilotMgr.getConfigurationSetting(
  ConfigurationName.GPS_FREQUENCY
);
console.log(config.value);

Configuration Name and Values

Configuration NameDescriptionConfiguration Values
SIDE_OF_STREET_MATCH_TYPE
Available in CoPilot 10.9.0.1180 and Higher
Determines whether to use the side of street provided by the address or by the latitude/longitude coordinates in the event that they return conflicting information .REQUIRE_ADDRESS_AND_LAT_LON_MATCH
PREFER_ADDRESS
PREFER_LAT_LON
FLOW_TRAFFIC_AVAILABILITYWhether or not the traffic service is enabled on the device.FLOW_TRAFFIC_ENABLED
FLOW_TRAFFIC_DISABLED
TRAFFIC_BAR_VISIBILITYWhether or not to show the traffic bar.TRAFFIC_BAR_SHOW
TRAFFIC_BAR_HIDE
ALLOW_INSERT_GPS_STOP
Available in CoPilot 10.9.0.1180 and Higher
When enabled, if the current GPS location is added to an existing trip, it will be added as the first stop WITHOUT replacing any stops. By default, CoPilot will replace the first stop with your current GPS location when you add it—if you have more than one stop.ADD_GPS_STOP
DO_NOT_ADD_GPS_STOP
PLAY_WELCOMEWhether or not to play the welcome greeting when starting CoPilot. SAY_WELCOME must also be on.PLAY_WELCOME_TRUE
DO_NOT_PLAY_WELCOME
SAY_WELCOMEWhether or not to play the welcome greeting when starting CoPilot. PLAY_WELCOME must also be on.SAY_WELCOME_TRUE
DO_NOT_SAY_WELCOME
SPEAK_CALCULATING_ROUTEWhether to speak calculating route.SPEAK_CALCULATING_ROUTE_TRUE
DO_NOT_SPEAK_CALCULATING_ROUTE
CHEVRON_DISPLAYThe information displayed below the chevron.CHEVRON_DISPLAY_NONE
CHEVRON_DISPLAY_CURRENT_ROAD
CHEVRON_DISPLAY_DESTINATION
CHEVRON_DISPLAY_NEAREST_TOWN
CHEVRON_DISPLAY_HEADING
CHEVRON_DISPLAY_LAT_LON
CHEVRON_DISPLAY_NAME_ADDRESS
CHEVRON_DISPLAY_NAME_ADDRESS
CHEVRON_DISPLAY_NAME_ZIPCODE
CHEVRON_DISPLAY_INSIGHTSTOP_NOTE
CHEVRON_DISPLAY_INSIGHTSTOP_CUSTOM
INFO_BAR_LEFTThe information to show in the left side info bar.INFO_BAR_DISPLAY_ELEVATION
INFO_BAR_DISPLAY_CURRENT_TIME
INFO_BAR_DISPLAY_ETT
INFO_BAR_DISPLAY_HEADING
INFO_BAR_DISPLAY_SPEED
INFO_BAR_DISPLAY_ETA
INFO_BAR_DISPLAY_DISTANCE
INFO_BAR_RIGHTThe information to show in the right side info bar.INFO_BAR_DISPLAY_ELEVATION
INFO_BAR_DISPLAY_CURRENT_TIME
INFO_BAR_DISPLAY_ETT
INFO_BAR_DISPLAY_HEADING
INFO_BAR_DISPLAY_SPEED
INFO_BAR_DISPLAY_ETA
INFO_BAR_DISPLAY_DISTANCE
SHOW_ARRIVAL_POPUPWhether to show a popup when arriving at your destination.SHOW_ARRIVAL_POPUP_TRUE
DO_NOT_SHOW_ARRIVAL_POPUP
ALLOW_ENABLE_COMPLIANCEWhether to turn on route compliance.ENABLE_COMPLIANCE_TRUE
ENABLE_COMPLIANCE_FALSE
POST_TO_FLEET_PORTALWhether or not CoPilot should communicate with FleetPortal.POST_TO_FLEET_PORTAL_TRUE
POST_TO_FLEET_PORTAL_FALSE
ENABLE_ADVANCED_ALERTSWhether to enable advanced speed alerts.ENABLE_ADVANCE_ALERTS
DISABLE_ADVANCE_ALERTS
ROUTING_SIDE_STREET_MILE_X100The cost to apply for side of street routing .SIDEOFSTREET_OFF
SIDEOFSTREET_MINIMAL
SIDEOFSTREET_MODERATE
SIDEOFSTREET_AVERAGE
SIDEOFSTREET_STRICT
SIDEOFSTREET_ADHERE
SIDEOFSTREET_STRONGADHERE
EDIT_ACCOUNT_SETTINGSWhether or not to display the Account IDs dialog.EDIT_ACCOUNT_SETTINGS_ENABLE
EDIT_ACCOUNT_SETTINGS_DISABLE
DRIVEXACT_ALERTSWhether or not DriveExact alerts are enabled.DRIVEXACT_ALERTS_ENABLE
DRIVEXACT_ALERTS_DISABLE
DISPLAY_STOP_NAME_STYLEHow to display the stop name.STOP_DISPLAY_ALL_INFORMATION
STOP_DISPLAY_NAME_ONLY
STOP_DISPLAY_ADDRESS_ONLY
STOP_SIDE_DISPLAYWhether or not to display the stop side.SHOW_STOP_SIDE
HIDE_STOP_SIDE
RESUME_DOWNLOAD_ON_STARTUPWhether or not to resume partially complete map downloads on startup.RESUME
DO_NOT_RESUME
ENABLE_TURN_ALERTWhether or not to provide alerts ahead of navigation turn instructions.TURN_ALERT_ENABLED
TURN_ALERT_DISABLED
MAP_DOWNLOADS_WIFI_ONLYWhether or not map downloads should be restricted to only take place over Wi-FiWIFI_ONLY
ALL_CONNECTIONS_ALLOWED
UNIQUE_CLUSTER_STRICTNESSSets strictness for unique clustering within Optimization.UNIQUE_CLUSTER_OFF
UNIQUE_CLUSTER_ON
UNIQUE_CLUSTER_ONLY
NAV_MESSAGE_DISPLAY
Available in CoPilot 10.9.0.1180 and Higher
Sets the type of banner to include at the top of all navigation views. (Default is no banner.)NAV_MESSAGE_DISPLAY_NONE
NAV_MESSAGE_DISPLAY_CURRENT_ROAD
NAV_MESSAGE_DISPLAY_DESTINATION
NAV_MESSAGE_DISPLAY_NEAREST_TOWN
NAV_MESSAGE_DISPLAY_HEADING
NAV_MESSAGE_DISPLAY_LAT_LON
NAV_MESSAGE_DISPLAY_NAME_ADDRESS
NAV_MESSAGE_DISPLAY_NAME_ZIPCODE
NAV_MESSAGE_DISPLAY_INSIGHTSTOP_NOTE
NAV_MESSAGE_DISPLAY_INSIGHTSTOP_CUSTOM
NAV_MESSAGE_DISPLAY_CUSTOM_MESSAGE
ALTERNATE_ROUTES_ALLOWEDSet to DO_NOT_ALLOW_ALTERNATE_ROUTES if you do not want CoPilot to suggest any alternate routes to the driver, such as when matching a route planned in the back office. (Default is allow.)ALLOW_ALTERNATE_ROUTES
DO_NOT_ALLOW_ALTERNATE_ROUTES
SHOW_COMPLIANCE_POPUP
Deprecated in CoPilot 10.19.3.48
Whether or not to show the compliance popup.SHOW_COMPLIANCE_POPUP_ENABLED
SHOW_COMPLIANCE_POPUP_DISABLED

StopBuilder

Overview
DescriptionBuilds stops using some of the optional parameters for creating stops. The basic workflow is:
1. Create a StopBuilder JSON object using one of the methods below.
2. Call the StopBuilder.geocode API to match the StopBuilder object to a location in the CoPilot map database.
3. Use the Stop JSON objects returned by StopBuilder.Geocode to add stops to your route.
Supported on React Native Since Version10.14
TypeNative Module

Methods

Method NameReturn TypeDescription
fromLatLon(Coordinate) StopBuilder Method to create a StopBuilder from a latitude / longitude combination.
fromCountryAndPostalCode(String, String) StopBuilder Method to create a StopBuilder from a country and postal code combination.
fromCityAndState (String, String) StopBuilder Method to create a StopBuilder from a city and state combination.
geocode(GeocodeSearchType)JSON array of Stop objectsGeocodes the address and returns the list of stops.
getNearbyStreets
String
Returns list of nearby streets relative to the coordinates passed to CoPilot, returned as StreetSearchResult

Sample Code

const StopBuilder = NativeModules.StopBuilder;
const GeocodeSearchType = NativeModules.GeocodeSearchType;

var latlon = {};
latlon.latitude = 40.36842;
latlon.longitude = -74.655036;
var stopBuilder = await StopBuilder.fromLatLon(latlon);
var stops = await StopBuilder.geocode(
  stopBuilder,
  GeocodeSearchType.BEST_MATCH
);

StopBuilder.Geocode(GeocodeSearchType)

Overview
DescriptionGeocodes the address and returns the list of stops.
Supported on React Native Since Version10.14
TypeMethod

Syntax

JSONArray geocode(stopBuilder, geocodeSearchType)

Parameters

A StopBuilder JSON object, which contains information about the stop.

geocodeSearchType - The type of geocode matching

Sample Code

const StopBuilder = NativeModules.StopBuilder;
const GeocodeSearchType = NativeModules.GeocodeSearchType;

var latlon = {};
latlon.latitude = 40.36842;
latlon.longitude = -74.655036;
var stopBuilder = await StopBuilder.fromLatLon(latlon);
var stops = await StopBuilder.geocode(
  stopBuilder,
  GeocodeSearchType.BEST_MATCH
);

StopBuilder.getNearbyStreets

Overview
DescriptionReturns a list of nearby streets relative to the coordinates passed to CoPilot. All nearby street names within the configurable distance, set as a maximum of 1 mile, will be returned. The number of streets returned can be set up to a maximum of 10. Streets will be returned sorted in order of distance.
Supported on React Native Since Version10.14
TypeMethod

Syntax

JSONArray getNearbyStreets(stopBuilder, distance, maxResults)

Parameters

A StopBuilder JSON object, which contains information about the stop.

distance- An int value for the maximum distance to return street names from. Maximum of 1 mile.

maxResults - An int value for the number of results to be returned. Maximum of 10.

Return Value

JSON Array of StreetSearchResult JSON objects

Sample Code

const StopBuilder = NativeModules.StopBuilder

var latlon = {};
latlon.latitude = 40.355233;
latlon.longitude = -74.604895;
var stopBuilder = await StopBuilder.fromLatLon(latlon);

var nearbyStreets = await StopBuilder.getNearbyStreets(stopBuilder, 5, 10)
Last updated May 11, 2023.