시작하기
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 명령어를 복사하십시오.
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의 AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 기능을 추가하려면 다음 명령어를 사용하세요:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsCopy to clipboard
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-android-sms-retriever` plugin in my project.Copy to clipboard
bun add @capgo/capacitor-android-sms-retrieverbunx cap sync androidImport
Importimport { AndroidSmsRetriever } from '@capgo/capacitor-android-sms-retriever';Android 요구 사항
Android 요구 사항SMS Retriever는 Android 기기의 Google Play 서비스가 필요합니다. 플러그인은 다음을 요청하지 않습니다. READ_SMS 또는 RECEIVE_SMS 권한.
인증 SMS는 앱 해시를 포함해야 합니다. 앱 해시는 Capgo에서 반환하는 해시입니다. getHashString()해시를 생성하려면 앱을 배포하는 데 사용하는 서명 키를 사용합니다. 디버그, 릴리스 및 Play App Signing 빌드는 다른 해시를 가질 수 있습니다.
인증 SMS를 기다리십시오
SMS 인증을 위한 Verification 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();앱 해시를 가져오기
이 해시를 백엔드에서 보낸 SMS의 끝에 사용하세요.const { hash } = await AndroidSmsRetriever.getHashString();console.log(hash);전화번호 힌트를 요청하세요
전화번호 힌트를 요청하는 방법
__CAPGO_KEEP_0__const { phoneNumber } = await AndroidSmsRetriever.getPhoneNumber();console.log(phoneNumber);Android는 사용자가 선택한 전화번호를 반환하는 데 사용되는 native Phone Number Hint UI를 표시합니다.
예제 SMS
예제 SMS<#> 123456 is your verification code.FA+9qCX9VSu앱 서명 키의 해시로 마지막 줄을 대체하세요.
시작하기
시작하기이미 사용 중이라면 시작하기 native plugin 작업을 계획하려면 그것을 연결하세요 native 기능을 사용하는 @capgo/capacitor-android-sms-retriever을 사용하세요. native 기능을 사용하는 @capgo/capacitor-android-sms-retriever을 사용하세요. Capgo 플러그인 디렉토리 Capgo 플러그인 디렉토리 Capacitor Plugins by Capgo Capacitor 플러그인 구현 세부 사항은 Capgo에서 제공됩니다. 플러그인 추가 또는 업데이트 플러그인 추가 또는 업데이트 아이오닉 엔터프라이즈 플러그인 대안 __CAPGO_KEEP_0__