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.
__CAPGO_KEEP_4__
__CAPGO_KEEP_5__bun add @capgo/capacitor-android-sms-retrieverbunx cap sync android__CAPGO_KEEP_8__
__CAPGO_KEEP_9__import { AndroidSmsRetriever } from '@capgo/capacitor-android-sms-retriever';__CAPGO_KEEP_11__
Android RequirementsAndroid 기기에서 Google Play 서비스가 필요합니다. 플러그인은 READ_SMS or RECEIVE_SMS 권한을 요청하지 않습니다.
SMS 인증을 위해 앱 해시가 포함된 SMS를 받으세요. 앱을 배포하기 위해 사용하는 서명 키의 해시를 생성하세요. Debug, release, 및 Play App Signing 빌드는 서로 다른 해시를 가질 수 있습니다. getHashString()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();클립보드에 복사
Stop Watchingawait AndroidSmsRetriever.stopWatch();__CAPGO_KEEP_0__을 얻으세요.
__CAPGO_KEEP_0__ 섹션 제목 ‘__CAPGO_KEEP_0__을 얻으세요.’const { hash } = await AndroidSmsRetriever.getHashString();console.log(hash);__CAPGO_KEEP_0__을 사용하여 백엔드에서 보낸 인증 SMS의 끝에 넣으세요.
전화번호 힌트 요청
__CAPGO_KEEP_0__ 섹션 제목 ‘전화번호 힌트 요청’const { phoneNumber } = await AndroidSmsRetriever.getPhoneNumber();console.log(phoneNumber);Android는 사용자가 선택한 전화번호를 반환하는 데 사용되는 native Phone Number Hint UI를 보여줍니다.
<#> 123456 is your verification code.FA+9qCX9VSu앱 서명 키의 해시를 넣어 마지막 줄을 대체하세요.
Getting Started에서 계속 진행하세요
Getting Started에서 계속 진행하는 방법Getting Started를 사용하시는 경우 Getting Started native 플러그인 작업을 계획하고자 할 때, Using @capgo/capacitor-android-sms-retriever Using @capgo/capacitor-android-sms-retriever를 사용하는 native 기능 Capgo Plugin Directory Capgo Plugin Directory를 사용하는 제품 워크플로우 Capacitor Plugins by Capgo Capacitor Plugins by Capgo의 구현 세부 사항 플러그인을 추가하거나 업데이트 하세요 implementation 상세 정보에 대한 구현 세부 정보를 Adding or Updating Plugins, 및 Ionic Enterprise Plugin Alternatives Ionic Enterprise Plugin Alternatives의 제품 워크플로에 대한