Skip to content

始め方

GitHub

CapgoのAIアシストセットアップを使用してプラグインをインストールできます。AIツールにCapgoスキルを追加するには、以下のコマンドを実行してください。

ターミナル画面
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

次に、以下のプロンプトを使用してください。

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

Manual Setupを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。

ターミナル画面
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({} as {
/**
* Destination coordinates [latitude, longitude]
*/
destination: [number, number];
/**
* Optional navigation options
*/
options?: NavigateOptions;
});

特定のナビゲーションアプリが利用可能かどうかを確認

import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.isAppAvailable({} as {
/**
* App identifier to check
*/
app: IOSNavigationApp | AndroidNavigationApp | string;
});

デバイス上で利用可能なナビゲーションアプリのリストを取得

import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.getAvailableApps();

現在のプラットフォームでサポートされているアプリのリストを取得

import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.getSupportedApps();

ナビゲーションのデフォルトアプリ名を取得

import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.getDefaultApp();

ナビゲーションのオプション

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

__CAPGO_KEEP_1__

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

__CAPGO_KEEP_1__

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

__CAPGO_KEEP_1__

アプリの利用可能性の確認結果

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

__CAPGO_KEEP_1__

交通モード

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

Launchモード.

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

このページはプラグインの src/definitions.tsAPIがアップストリームで変更された場合に、再度同期を実行してください。

Getting Startedから続けてください

「Getting Startedから続けてください」セクション

Capgoを使用している場合 Getting Started ダッシュボードとAPIの作業計画を立てるには、 Using @capgo/capacitor-launch-navigator Using @capgo/capacitor-launch-navigatorのネイティブ機能 APIの概要 APIの実装詳細 導入 __CAPGO_KEEP_0__のキー APIの実装詳細 for the implementation detail in API Keys, and __CAPGO_KEEP_0__の実装詳細 ページを編集