Getting Started
설치 단계와 이 플러그인의 전체 마크다운 가이드와 함께 설정 프롬프트를 복사합니다.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-android-sms-retriever`
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/android-sms-retriever/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.
설치
설치 제목AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. 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-android-sms-retriever` plugin in my project.만약 Manual Setup을 선호한다면, 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요.
bun add @capgo/capacitor-android-sms-retrieverbunx cap sync androidImport
Import라는 제목의 섹션import { AndroidSmsRetriever } from '@capgo/capacitor-android-sms-retriever';Android Requirements
Android Requirements라는 제목의 섹션SMS Retriever는 Android 기기의 Google Play 서비스가 필요합니다. 플러그인은 Android 기기에 Google Play 서비스를 요청하지 않습니다. READ_SMS 또는 RECEIVE_SMS 권한.
인증 SMS는 앱 해시를 반환하는 getHashString()을 포함해야 합니다.
앱을 배포하는 데 사용되는 서명 키의 해시를 생성하십시오. Debug, release 및 Play App Signing 빌드는 서로 다른 해시를 가질 수 있습니다.
인증 SMS를 듣기import { AndroidSmsRetriever } from '@capgo/capacitor-android-sms-retriever';
const received = await AndroidSmsRetriever.addListener('smsReceived', ({ message }) => { const code = message.match(/\b\d{6}\b/)?.[0]; console.log('Verification code:', code);});
const timeout = await AndroidSmsRetriever.addListener('smsRetrieverTimeout', () => { console.log('SMS Retriever timed out');});
const errors = await AndroidSmsRetriever.addListener('smsRetrieverError', ({ message }) => { console.error('SMS Retriever error:', message);});
await AndroidSmsRetriever.startWatch();
// Remove listeners when the verification flow is done.await received.remove();await timeout.remove();await errors.remove();클립보드에 복사
중지await AndroidSmsRetriever.stopWatch();클립보드에 복사
앱 해시를 가져오기const { hash } = await AndroidSmsRetriever.getHashString();console.log(hash);__CAPGO_KEEP_1__
__CAPGO_KEEP_2__
__CAPGO_KEEP_3__const { phoneNumber } = await AndroidSmsRetriever.getPhoneNumber();console.log(phoneNumber);__CAPGO_KEEP_4__
__CAPGO_KEEP_5__
__CAPGO_KEEP_6__<#> 123456 is your verification code.FA+9qCX9VSu__CAPGO_KEEP_7__
__CAPGO_KEEP_8__
__CAPGO_KEEP_9__만약 native plugin 작업을 계획하고 있다면 Getting Started native plugin 작업을 위해 Using @capgo/capacitor-android-sms-retriever native 기능을 위해 Using @capgo/capacitor-android-sms-retriever를 사용합니다. Capgo Plugin Directory Capgo Plugin Directory를 사용하여 제품 워크플로우를 구현합니다. Capacitor Plugins by Capgo Capacitor Plugins by Capgo에서 구현 세부 사항을 확인합니다. Adding or Updating Plugins Adding or Updating Plugins에서 구현 세부 사항을 확인하고 Ionic Enterprise Plugin Alternatives __CAPGO_KEEP_0__