__CAPGO_KEEP_0__
이 플러그인의 설치 단계와 전체 마크다운 가이드를 포함한 설정 지시서를 복사하세요.
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 요구 사항
Android 요구 사항 섹션Android 기기에서 Google Play 서비스가 필요합니다. 플러그인은 권한을 요청하지 않습니다. SMS 리트리버는 READ_SMS 또는 RECEIVE_SMS 권한이 없습니다.
SMS 인증을 위해 앱 해시가 포함된 인증 SMS를 포함해야 합니다. 앱 해시는 getHashString()앱을 배포하기 위해 사용하는 서명 키의 해시를 생성하세요. Debug, release, 및 Play App Signing 빌드는 다른 해시를 가질 수 있습니다.
SMS 인증을 위해 듣기
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);휴대폰 번호 힌트 요청
관찰 중단
복사const { phoneNumber } = await AndroidSmsRetriever.getPhoneNumber();console.log(phoneNumber);Android는 사용자가 선택한 전화번호를 반환하는 네이티브 전화번호 힌트 UI를 보여줍니다.
예제 SMS
예제 SMS<#> 123456 is your verification code.FA+9qCX9VSu앱 서명 키의 해시로 대체하세요.
Getting Started에서 계속
Getting Started에서 계속Capacitor를 사용하는 경우 Getting Started Capacitor를 사용하는 경우 Capacitor를 사용하는 경우 @capgo/capacitor-android-sms-retriever를 사용하여 @capgo/capacitor-android-sms-retriever의 네이티브 기능과 연결하세요. for the native capability in Using @capgo/capacitor-android-sms-retriever, Capgo 플러그인 디렉토리 Capgo 플러그인 디렉토리에서 제품 워크플로우를 위해 Capacitor 플러그인들에 의해 Capgo Capacitor 플러그인들에 의해 Capgo에서 구현 세부 사항을 위해 플러그인 추가 또는 업데이트 플러그인 추가 또는 업데이트에서 구현 세부 사항을 위해, 및 아이오닉 엔터프라이즈 플러그인 대체 아이오닉 엔터프라이즈 플러그인 대체에서 제품 워크플로우를 위해