Prise en main
Copiez un prompt de configuration incluant les étapes d'installation et le guide markdown complet pour ce plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-launch-navigator`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/launch-navigator/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Installer
Section intitulée « Installation »Vous pouvez utiliser notre configuration assistée par IA pour installer le plugin. Ajoutez les skills Capgo à votre outil d'IA avec la commande suivante :
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsUtilisez ensuite le prompt suivant :
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-launch-navigator` plugin in my project.Si vous préférez une installation manuelle, installez le plugin en exécutant les commandes suivantes et suivez les instructions spécifiques à chaque plateforme ci-dessous :
bun add @capgo/capacitor-launch-navigatorbunx cap syncImporter
Section intitulée « Import »import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';Démarrage rapide
Section intitulée « Démarrage rapide »import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.navigate({ destination: [37.7749, -122.4194], options: { app: 'google_maps' },});Example: let the user pick a map app
Section titled “Example: let the user pick a map app”const { apps } = await LaunchNavigator.getAvailableApps();// render chooser UI, then navigate with options.app set to the selectionExemple : géocoder d'abord
Section intitulée « Exemple : géocoder d’abord »Utiliser @capgo/capacitor-nativegeocoder forwardGeocode() pour convertir une adresse en [lat, lng] avant d’appeler navigate().
Erreurs courantes
Section intitulée « Erreurs courantes »- Coordonnées uniquement: les adresses postales ne sont pas acceptées par
navigate(). - Le Web: ouvre un lien de cartes externe, pas une application installée.
- Icônes: cache avec
getAppIcons()and refresh when the user installs a new maps app.
Aperçu de API
Section intitulée « Aperçu API »navigate
Section intitulée « navigate »Naviguer vers un lieu à l'aide de la latitude et de la longitude
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.navigate({ destination: [48.8566, 2.3522] });isAppAvailable
Section intitulée « isAppAvailable »Vérifier si une application de navigation spécifique est disponible
import { LaunchNavigator, IOSNavigationApp } from '@capgo/capacitor-launch-navigator';
const result = await LaunchNavigator.isAppAvailable({ app: IOSNavigationApp.APPLE_MAPS });console.log(result);getAvailableApps
Section intitulée « getAvailableApps »Obtenir la liste des applications de navigation disponibles sur l'appareil
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
const result = await LaunchNavigator.getAvailableApps();console.log(result);getSupportedApps
Section intitulée « getSupportedApps »Get list of supported apps for the current platform
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
const result = await LaunchNavigator.getSupportedApps();console.log(result);getDefaultApp
Section intitulée « getDefaultApp »Récupère le nom de l’application de navigation par défaut
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
const result = await LaunchNavigator.getDefaultApp();console.log(result);Référence de type
Section intitulée « Référence de type »NavigateOptions
Section intitulée « NavigateOptions »Options de 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;}IOSNavigationApp
Section intitulée « IOSNavigationApp »Applications de navigation disponibles sur 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',}AndroidNavigationApp
Section intitulée « AndroidNavigationApp »Applications de navigation disponibles pour 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',}AvailableApp
Section intitulée « AvailableApp »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;}TransportMode
Section intitulée « TransportMode »Modes de transport.
export enum TransportMode { DRIVING = 'driving', WALKING = 'walking', BICYCLING = 'bicycling', TRANSIT = 'transit',}LaunchMode
Section intitulée « LaunchMode »Modes de lancement.
export enum LaunchMode { MAPS = 'maps', TURN_BY_TURN = 'turn_by_turn', GEO = 'geo',}Source de vérité
Section intitulée « Source de vérité »Cette page est générée à partir de src/definitions.ts. Relancez la synchronisation lorsque l’API public change en amont.
Continuer depuis Getting Started
Section intitulée « Continuer après Prise en main »Si vous utilisez Prise en main pour planifier les opérations du dashboard et de API, connectez-l’avec Utiliser @capgo/capacitor-launch-navigator pour la capacité native dans Utiliser @capgo/capacitor-launch-navigator, Aperçu de API pour les détails d'implémentation dans « Vue d'ensemble de API », Introduction pour les détails d'implémentation dans l'introduction, Clés API pour les détails d'implémentation dans « Clés API », et Appareils pour les détails d'implémentation dans Devices.