주요 콘텐츠로 건너뛰기
플러그인으로 돌아가기
@capgo/capacitor-intent-launcher
튜토리얼
@capgo/capacitor-intent-launcher

인텐트 런처

Launch Android intents, open system settings, and interact with other apps using the Intent system

__CAPGO_KEEP_0__

Using __CAPGO_KEEP_0__ for __CAPGO_KEEP_1__-intent-launcher

Using @capgo/capacitor-intent-launcher

Capacitor

설치

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

이 플러그인은 다음을 제공합니다.

  • startActivityAsync - Android 액티비티를 시작하는 데 사용되는 액션을 지정합니다.
  • openIOSSettings - iOS 설정 화면을 엽니다.
  • openApplication - 패키지 이름으로 애플리케이션을 엽니다.
  • getApplicationIconAsync - 애플리케이션 아이콘을 base64로 인코딩된 PNG 문자열로 가져옵니다.

예시 사용법

startActivityAsync

Android 액티비티를 시작하는 데 사용되는 액션을 지정합니다.

import { IntentLauncher } 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 } 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;
}

전체 참조

capgo을 계속 사용하세요. @capgo/capacitor-intent-launcher

__CAPGO_KEEP_0__을 사용하고 있다면 Using @capgo/capacitor-intent-launcher @API/__CAPGO_KEEP_1__-intent-launcher @capgo/capacitor-intent-launcher @capgo/capacitor-intent-launcher 시작하기 __CAPGO_KEEP_0__를 사용하여 API 개요 implementation 세부 정보를 위한 API 개요 소개 implementation 세부 정보를 위한 Introduction API 키 implementation 세부 정보를 위한 API 키