Launch Navigator

Improve this doc

$ ionic plugin add uk.co.workingedge.phonegap.plugin.launchnavigator
$ npm install --save @ionic-native/launch-navigator

Repo: https://github.com/dpa99c/phonegap-launch-navigator

Requires Cordova plugin: uk.co.workingedge.phonegap.plugin.launchnavigator. For more info, please see the LaunchNavigator plugin docs.

Supported platforms

Usage

Please refer to the plugin's repo for detailed usage. This docs page only explains the Native wrapper.

import { LaunchNavigator, LaunchNavigatorOptions } from '@ionic-native/launch-navigator';

constructor(private launchNavigator: LaunchNavigator) { }

...

let options: LaunchNavigatorOptions = {
  start: 'London, ON',
  app: LaunchNavigator.APPS.UBER
};

this.launchNavigator.navigate('Toronto, ON', options)
  .then(
    success => console.log('Launched navigator'),
    error => console.log('Error launching navigator', error)
  );

Instance Members

navigate(destination, options)

Launches navigator app

Param Type Details
destination string|Array.<number>

Location name or coordinates (as string or array)

options LaunchNavigatorOptions

Returns: Promise<any>

isAppAvailable(app)

Determines if the given app is installed and available on the current device.

Param Type Details
app string

Returns: Promise<any>

availableApps()

Returns a list indicating which apps are installed and available on the current device.

Returns: Promise<string[]>

getAppDisplayName(app)

Returns the display name of the specified app.

Param Type Details
app string

Returns: string

getAppsForPlatform(platform)

Returns list of supported apps on a given platform.

Param Type Details
platform string

Returns: string[]

supportsTransportMode(app, platform)

Indicates if an app on a given platform supports specification of transport mode.

Param Type Details
app string

specified as a string, you can use one of the constants, e.g LaunchNavigator.APP.GOOGLE_MAPS

platform string

Returns: boolean

getTransportModes(app, platform)

Returns the list of transport modes supported by an app on a given platform.

Param Type Details
app string
platform string

Returns: string[]

supportsLaunchMode(app, platform)

Indicates if an app on a given platform supports specification of launch mode. Note that currently only Google Maps on Android does.

Param Type Details
app string
platform string

Returns: boolean

supportsStart(app, platform)

Indicates if an app on a given platform supports specification of start location.

Param Type Details
app string
platform string

Returns: boolean

supportsStartName(app, platform)

Param Type Details
app string
platform string

Returns: boolean

supportsDestName(app, platform)

Param Type Details
app string
platform string

Returns: boolean

userSelect(destination, options)

Param Type Details
destination string|Array.<number>
options LaunchNavigatorOptions

APP

TRANSPORT_MODE

LaunchNavigatorOptions

Param Type Details
app string

name of the navigation app to use for directions. Specify using launchnavigator.APP constants. If not specified, defaults to User Selection.

(optional)
destinationName string

nickname to display in app for destination. e.g. "Bob's House".

(optional)
start string | number[]

Start point of the navigation

(optional)
startName string

nickname to display in app for start . e.g. "My House".

(optional)
transportMode string

Transportation mode for navigation: "driving", "walking" or "transit". Defaults to "driving" if not specified.

(optional)
enableDebug boolean

If true, debug log output will be generated by the plugin. Defaults to false.

(optional)
extras any

a key/value map of extra app-specific parameters. For example, to tell Google Maps on Android to display Satellite view in "maps" launch mode: {"t": "k"}

(optional)
launchMode string

(Android only) mode in which to open Google Maps app: "maps" or "turn-by-turn". Defaults to "maps" if not specified. Specify using launchnavigator.LAUNCH_MODE constants.

(optional)
appSelectionDialogHeader string

text to display in the native picker which enables user to select which navigation app to launch. Defaults to "Select app for navigation" if not specified.

(optional)
appSelectionCancelButton string

text to display for the cancel button in the native picker which enables user to select which navigation app to launch. Defaults to "Cancel" if not specified.

(optional)
successCallback Function (optional)
errorCallback Function (optional)

API

Native

General