Skip to content

Getting Started

GitHub

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

Terminal window
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Then use the following prompt:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-launch-navigator` plugin in my project.

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:

Terminal window
bun add @capgo/capacitor-launch-navigator
bunx cap sync
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.navigate({
destination: [37.7749, -122.4194],
options: { app: 'google_maps' },
});
const { apps } = await LaunchNavigator.getAvailableApps();
// render chooser UI, then navigate with options.app set to the selection

Use @capgo/capacitor-nativegeocoder forwardGeocode() to turn an address into [lat, lng] before calling navigate().

  • Coordinates only: street addresses are not accepted by navigate().
  • Web: opens an external maps link, not an installed app.
  • Icons: cache with getAppIcons() and refresh when the user installs a new maps app.

Navigate to a location using latitude and longitude

import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.navigate({ destination: [48.8566, 2.3522] });

Check if a specific navigation app is available

import { LaunchNavigator, IOSNavigationApp } from '@capgo/capacitor-launch-navigator';
const result = await LaunchNavigator.isAppAvailable({ app: IOSNavigationApp.APPLE_MAPS });
console.log(result);

Get list of available navigation apps on the device

import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
const result = await LaunchNavigator.getAvailableApps();
console.log(result);

Get list of supported apps for the current platform

import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
const result = await LaunchNavigator.getSupportedApps();
console.log(result);

Get the name of the default app for navigation

import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
const result = await LaunchNavigator.getDefaultApp();
console.log(result);

Options for navigation.

export interface NavigateOptions {
/**
* Starting location coordinates [latitude, longitude]
*/
start?: [number, number];
/**
* Starting location name
*/
startName?: string;
/**
* Destination name (will be ignored since we only support coordinates)
*/
destinationName?: string;
/**
* Transport mode
*/
transportMode?: TransportMode;
/**
* Specific app to launch (if not specified, will use default or prompt)
*/
app?: IOSNavigationApp | AndroidNavigationApp | string;
/**
* Launch mode
*/
launchMode?: LaunchMode;
/**
* Additional parameters specific to certain apps
*/
extras?: Record<string, any>;
/**
* Enable debug logging
*/
enableDebug?: boolean;
}

Available navigation apps for iOS.

export enum IOSNavigationApp {
APPLE_MAPS = 'apple_maps',
GOOGLE_MAPS = 'google_maps',
WAZE = 'waze',
CITYMAPPER = 'citymapper',
GARMIN_NAVIGON = 'garmin_navigon',
TRANSIT_APP = 'transit_app',
YANDEX_NAVIGATOR = 'yandex',
UBER = 'uber',
TOMTOM = 'tomtom',
SYGIC = 'sygic',
HERE_MAPS = 'here',
MOOVIT = 'moovit',
LYFT = 'lyft',
MAPS_ME = 'mapsme',
CABIFY = 'cabify',
BAIDU = 'baidu',
GAODE = 'gaode',
TAXI_99 = '99taxi',
}

Available navigation apps for Android.

export enum AndroidNavigationApp {
GOOGLE_MAPS = 'google_maps',
WAZE = 'waze',
CITYMAPPER = 'citymapper',
UBER = 'uber',
YANDEX = 'yandex',
SYGIC = 'sygic',
HERE_MAPS = 'here',
MOOVIT = 'moovit',
LYFT = 'lyft',
MAPS_ME = 'mapsme',
CABIFY = 'cabify',
BAIDU = 'baidu',
GAODE = 'gaode',
}

Result of checking app availability.

export interface AvailableApp {
/**
* App identifier
*/
app: string;
/**
* Display name of the app
*/
name: string;
/**
* Whether the app is available on the device
*/
available: boolean;
}

Transport modes.

export enum TransportMode {
DRIVING = 'driving',
WALKING = 'walking',
BICYCLING = 'bicycling',
TRANSIT = 'transit',
}

Launch modes.

export enum LaunchMode {
MAPS = 'maps',
TURN_BY_TURN = 'turn_by_turn',
GEO = 'geo',
}

This page is generated from the plugin’s src/definitions.ts. Re-run the sync when the public API changes upstream.

If you are using Getting Started to plan dashboard and API operations, connect it with Using @capgo/capacitor-launch-navigator for the native capability in Using @capgo/capacitor-launch-navigator, API Overview for the implementation detail in API Overview, Introduction for the implementation detail in Introduction, API Keys for the implementation detail in API Keys, and Devices for the implementation detail in Devices.