メイン コンテンツにスキップ
@capgo/capacitor-インテント ランチャー デバイス API オープン ソース

インテント ランチャー Capacitor プラグイン

Android インテントを起動、システム設定を開き、他のアプリと相互作用するには、Intent システムを使用します。

インストール

bun add @capgo/capacitor-intent-launcher bunx cap sync
npm、pnpm または yarn
  • npm install @capgo/capacitor-intent-launcher
  • pnpm add @capgo/capacitor-intent-launcher
  • yarn add @capgo/capacitor-intent-launcher

ガイド

How to use Intent Launcher in Capacitor

デバイスでテスト

Capgoアプリをダウンロードし、QR codeをスキャンしてください。

Intent Launcher プラグインのプレビューQRコードcode

@capgo/capacitor-intent-launcherを使用

CapacitorはAndroidのインテントを起動し、AndroidとiOS両方でシステム設定を開くAndroidとiOS用のインテントランチャープラグイン

インストール

bun add @capgo/capacitor-intent-launcher
bunx cap sync

bunx cap sync プラグインのネイティブcodeをプロジェクトにコピーします。プラグインのアップグレード後は再度実行してください。

インポート

import { IntentLauncher } from '@capgo/capacitor-intent-launcher';

APIの概要

方法 概要
startActivityAsync 指定されたアクションに対してAndroidアクティビティを開始します。
openIOSSettings iOS設定画面を開きます。
openApplication パッケージ名でアプリケーションを開きます。
getApplicationIconAsync アプリケーションアイコンをbase64エンコードされたPNG文字列として取得します。

例

startActivityAsync()

指定されたアクションに対してAndroidアクティビティを開始します。

import { IntentLauncher, ActivityAction } from '@capgo/capacitor-intent-launcher';

// Open location settings
const result = await IntentLauncher.startActivityAsync({
  action: ActivityAction.LOCATION_SOURCE_SETTINGS
});

// Open a specific app settings
const result = await IntentLauncher.startActivityAsync({
  action: ActivityAction.APPLICATION_DETAILS_SETTINGS,
  data: 'package:com.example.app'
});

openIOSSettings()

iOS設定画面を開きます。

import { IntentLauncher, IOSSettings } from '@capgo/capacitor-intent-launcher';

// Open app settings (recommended - officially supported by Apple)
await IntentLauncher.openIOSSettings({ option: IOSSettings.App });

// Open WiFi settings (may not work in all iOS versions)
await IntentLauncher.openIOSSettings({ option: IOSSettings.WiFi });

openApplication()

パッケージ名でアプリケーションを開きます。

import { IntentLauncher } from '@capgo/capacitor-intent-launcher';

// Open Gmail app
await IntentLauncher.openApplication({ packageName: 'com.google.android.gm' });

getApplicationIconAsync()

アプリケーションアイコンをbase64エンコードされたPNG文字列として取得します。

import { IntentLauncher } from '@capgo/capacitor-intent-launcher';

const { icon } = await IntentLauncher.getApplicationIconAsync({
  packageName: 'com.google.android.gm'
});
if (icon) {
  const img = document.createElement('img');
  img.src = icon;
}

context

@capgo/capacitor-intent-launcherを継続して使用してください。

Capacitor インテント ランチャーを使用している場合 @Capacitor-capgo/capacitor-intent-launcher 計画ダッシュボードとAPIの運用を、接続する @capgo/capacitor-intent-launcher Capacitor の実装詳細については @capgo/capacitor-intent-launcher に関するものです。 Capacitor インテント ランチャーを使用して Capacitor インテント ランチャーを使用して API Overview for the API の実装詳細について 概要 概要の実装詳細について API キー API キーの実装詳細について

FAQ

Intent Launcher プラグイン FAQ

Capacitor インテント ランチャー プラグインをどのように Capacitor アプリにインストールするか。

Run "bun add @capgo/capacitor-intent-launcher" (or "npm install @capgo/capacitor-intent-launcher"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-intent-launcher" in your app code.

Does @capgo/capacitor-intent-launcher work with React, Vue and Angular?

Yes. Intent Launcher is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-intent-launcher support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

@capgo/capacitor-intent-launcher は無料でオープンソースですか?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-intent-launcher/ and the package is free to install from npm. Bug reports and pull requests are welcome.

アップデート code が App Store でのレビューなしで使用することができるか?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

アプリレビューの待たずに、Intent Launcherの変更を配信する

プラグインがストアビルドに追加されたら、Capgo ライブアップデートは、ユーザーにJavaScript、HTML、CSSの変更を数分で反映する

Capgo で始める