Erste Schritte
Kopiere einen Setup-Prompt mit den Installationsschritten und dem vollständigen Markdown-Guide für dieses 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.
Installieren
Abschnitt „Installation“Du kannst unser KI-gestütztes Setup nutzen, um das Plugin zu installieren. Füge die Capgo Skills mit dem folgenden Befehl deinem KI-Tool hinzu:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsNutze dann diesen Prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-launch-navigator` plugin in my project.Wenn du ein manuelles Setup bevorzugst, installiere das Plugin mit den folgenden Befehlen und befolge die plattformspezifischen Anweisungen unten:
bun add @capgo/capacitor-launch-navigatorbunx cap syncImportieren
Abschnitt mit dem Titel „Import“import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';Quickstart
Abschnitt „Quick start“import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.navigate({ destination: [37.7749, -122.4194], options: { app: 'google_maps' },});Beispiel: den Nutzer eine Karten-App auswählen lassen
Beispiel: Der Nutzer wählt eine Karten-App ausconst { apps } = await LaunchNavigator.getAvailableApps();// render chooser UI, then navigate with options.app set to the selectionBeispiel: zuerst Geocoding durchführen
Beispiel: Erst Geocoding durchführenNutzt @capgo/capacitor-nativegeocoder forwardGeocode() um eine Adresse in [lat, lng] vor dem Aufruf von navigate().
Häufige Stolperfallen
Abschnitt „Häufige Fallstricke“- Nur Koordinaten: Adressen werden nicht von
navigate(). - Web: öffnet einen externen Maps-Link, keine installierte App.
- Icons: cachen mit
getAppIcons()und aktualisieren, wenn der User eine neue Maps-App installiert.
API Übersicht
Abschnitt „API Übersicht“Navigiere zu einem Ort via Breitengrad und Längengrad
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.navigate({ destination: [48.8566, 2.3522] });isAppAvailable
Abschnitt „isAppAvailable“Prüfen, ob eine bestimmte Navigations-App verfügbar ist
import { LaunchNavigator, IOSNavigationApp } from '@capgo/capacitor-launch-navigator';
const result = await LaunchNavigator.isAppAvailable({ app: IOSNavigationApp.APPLE_MAPS });console.log(result);getAvailableApps
Abschnitt „getAvailableApps“Liste der verfügbaren Navigations-Apps auf dem Gerät abrufen
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
const result = await LaunchNavigator.getAvailableApps();console.log(result);getSupportedApps
Abschnitt „getSupportedApps“Liste der unterstützten Apps für die aktuelle Plattform abrufen
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
const result = await LaunchNavigator.getSupportedApps();console.log(result);getDefaultApp
Abschnitt „getDefaultApp“Namen der Standard-App für die Navigation abrufen
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
const result = await LaunchNavigator.getDefaultApp();console.log(result);Typreferenz
Abschnitt mit dem Titel „Typreferenz“NavigateOptions
Abschnitt „NavigateOptions“Optionen für die 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
Abschnitt „IOSNavigationApp“Verfügbare Navigations-Apps für 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
Abschnitt „AndroidNavigationApp“Verfügbare Navigations-Apps für 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
Abschnitt „AvailableApp“Ergebnis der Prüfung der App-Verfügbarkeit.
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
Abschnitt „TransportMode“Transportmodi.
export enum TransportMode { DRIVING = 'driving', WALKING = 'walking', BICYCLING = 'bicycling', TRANSIT = 'transit',}LaunchMode
Abschnitt „LaunchMode“Launch-Modi.
export enum LaunchMode { MAPS = 'maps', TURN_BY_TURN = 'turn_by_turn', GEO = 'geo',}Source of Truth
Abschnitt mit dem Titel „Source of Truth“Diese Seite wird aus dem Plugin generiert src/definitions.ts. Führe den Sync erneut aus, wenn sich das öffentliche API upstream ändert.
Weiter geht's nach Getting Started
Abschnitt: „Weiter geht’s mit Getting Started“Wenn du es nutzt Erste Schritte um Dashboard- und API-Operationen zu planen, verbinde es mit Mit @capgo/capacitor-launch-navigator für die native Funktion bei der Nutzung von @capgo/capacitor-launch-navigator, API Übersicht für Details zur Implementierung im API Overview, Einführung für die Implementierungsdetails in der Einleitung, API Schlüssel für das Implementierungsdetail in API Keys und Geräte für das Implementierungsdetail in Devices.