@capgo/capacitor-android-sms-retriever
Overview
Section titled “Overview”@capgo/capacitor-android-sms-retriever wraps Google Play services SMS Retriever and Phone Number Hint APIs for Android-only Capacitor verification flows.
The plugin lets your app listen for a single verification SMS addressed to your app without requesting SMS permissions. It can also show Android’s native Phone Number Hint UI so users can choose a SIM-based phone number without typing it manually.
Core Capabilities
Section titled “Core Capabilities”startWatch- Start a five-minute SMS Retriever watch for one verification SMS.stopWatch- Stop the active SMS Retriever watch.getHashString- Read the 11-character app hash used in verification SMS messages.getPhoneNumber- Open Android Phone Number Hint and return the selected phone number.smsReceived- Listen for the retrieved verification SMS.smsRetrieverTimeout- Listen for the five-minute timeout.smsRetrieverError- Listen for runtime errors from Android or Google Play services.
Platform Support
Section titled “Platform Support”| Platform | Support |
|---|---|
| Android | Supported |
| iOS | Unsupported stub |
| Web | Unsupported stub |
Public API
Section titled “Public API”| Method | Description |
|---|---|
startWatch | Start listening for one verification SMS. |
stopWatch | Stop the active watch. |
getHashString | Return the 11-character app hash. |
getPhoneNumber | Show Phone Number Hint and return the selected number. |
addListener('smsReceived', ...) | Receive the retrieved SMS payload. |
addListener('smsRetrieverTimeout', ...) | Handle timeout events. |
addListener('smsRetrieverError', ...) | Handle retriever errors. |
getPluginVersion | Return the native plugin version. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-android-sms-retriever.
Keep going from @capgo/capacitor-android-sms-retriever
Section titled “Keep going from @capgo/capacitor-android-sms-retriever”If you are using @capgo/capacitor-android-sms-retriever to plan native plugin work, connect it with Using @capgo/capacitor-android-sms-retriever for the native capability in Using @capgo/capacitor-android-sms-retriever, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins, and Ionic Enterprise Plugin Alternatives for the product workflow in Ionic Enterprise Plugin Alternatives.