Zum Inhalt springen

Getting Started

GitHub

Sie können unsere AI-gestützte Einrichtung verwenden, um das Plugin zu installieren. Fügen Sie den Capgo-Fähigkeiten Ihrer AI-Anwendung mit folgendem Befehl hinzu:

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

Verwenden Sie dann folgende Anfrage:

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

Wenn Sie eine manuelle Einrichtung bevorzugen, installieren Sie das Plugin, indem Sie die folgenden Befehle ausführen und die darunter angegebenen Plattform-spezifischen Anweisungen befolgen.

Terminal-Fenster
bun add @capgo/capacitor-launch-navigator
bunx cap sync
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';

Zur Position navigieren, die durch Breite und Länge gegeben ist

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

Überprüfen, ob eine bestimmte Navigation-App verfügbar ist

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

Liste der verfügbaren Navigation-Apps auf dem Gerät abrufen

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

Liste der unterstützten Apps für die aktuelle Plattform erhalten

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

Name der Standard-App für die Navigation erhalten

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

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;
}

Verfügbare Navigation-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',
}

Verfügbare Navigation-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',
}

Ergbnis der App-Verfügbarkeitsprüfung.

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

Verfügbare Transportarten.

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

Startmodi.

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

Diese Seite wird aus dem Plugin generiert. src/definitions.tsRe-run die Synchronisierung, wenn die öffentliche API upstream geändert wird.

Wenn Sie das verwenden Getting Started um das Dashboard und API-Operationen zu planen, verbinden Sie es mit Verwenden Sie @capgo/capacitor-launch-navigator Erfahren Sie mehr über die native Fähigkeit in @capgo/capacitor-Launch-Navigator API Übersicht Erfahren Sie mehr über die Implementierungsdetails in API Übersicht Einführung Erfahren Sie mehr über die Implementierungsdetails in Einführung API Schlüssel für die Implementierungsdetails in API Schlüsseln und Geräte Erfahren Sie mehr über die Implementierungsdetails in Geräte.