
Security News
Anthropic Identifies Biased Reasoning and Recklessness as Drivers of Claude’s PyPI Attack
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.
@capgo/capacitor-android-sms-retriever
Advanced tools
Capacitor plugin for Android SMS Retriever and Phone Number Hint APIs.
Android-only Capacitor plugin for Google Play services SMS Retriever and Phone Number Hint APIs.
You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:
npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-plugins
Then use the following prompt:
Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-android-sms-retriever` plugin in my project.
If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:
bun add @capgo/capacitor-android-sms-retriever
bunx cap sync android
This plugin does not request SMS permissions. SMS retrieval uses Google Play services and waits for one matching verification SMS for up to five minutes.
The verification SMS must include the app hash returned by getHashString().
import { AndroidSmsRetriever } from '@capgo/capacitor-android-sms-retriever';
const { hash } = await AndroidSmsRetriever.getHashString();
console.log('SMS hash:', hash);
const received = await AndroidSmsRetriever.addListener('smsReceived', ({ message }) => {
console.log('Verification SMS:', message);
});
await AndroidSmsRetriever.addListener('smsRetrieverTimeout', () => {
console.log('SMS Retriever timed out');
});
await AndroidSmsRetriever.startWatch();
// Later, if needed:
await AndroidSmsRetriever.stopWatch();
await received.remove();
const { phoneNumber } = await AndroidSmsRetriever.getPhoneNumber();
console.log(phoneNumber);
startWatch()stopWatch()getHashString()getPhoneNumber()addListener('smsReceived', ...)addListener('smsRetrieverTimeout', ...)addListener('smsRetrieverError', ...)removeAllListeners()getPluginVersion()Android-only Capacitor plugin for Google Play services SMS Retriever and Phone Number Hint APIs.
startWatch() => Promise<StartWatchResult>
Start listening for one verification SMS through Android's SMS Retriever API.
Android stops listening automatically when a matching message arrives or after the five-minute SMS Retriever timeout. No SMS permissions are required.
Returns: Promise<StartWatchResult>
Since: 8.0.0
stopWatch() => Promise<StopWatchResult>
Stop the active SMS Retriever watch, if any.
Returns: Promise<StopWatchResult>
Since: 8.0.0
getHashString() => Promise<GetHashStringResult>
Get the 11-character app hash for the installed app signature.
Generate this once for the signing key used to distribute the app and append it to verification SMS messages.
Returns: Promise<GetHashStringResult>
Since: 8.0.0
getPhoneNumber() => Promise<GetPhoneNumberResult>
Show Android's Phone Number Hint UI and return the user-selected SIM-based phone number.
Returns: Promise<GetPhoneNumberResult>
Since: 8.0.0
addListener(eventName: 'smsReceived', listenerFunc: (event: SmsReceivedEvent) => void) => Promise<PluginListenerHandle>
Listen for a verification SMS received after {@link startWatch}.
| Param | Type |
|---|---|
eventName | 'smsReceived' |
listenerFunc | (event: SmsReceivedEvent) => void |
Returns: Promise<PluginListenerHandle>
Since: 8.0.0
addListener(eventName: 'smsRetrieverTimeout', listenerFunc: () => void) => Promise<PluginListenerHandle>
Listen for the five-minute SMS Retriever timeout.
| Param | Type |
|---|---|
eventName | 'smsRetrieverTimeout' |
listenerFunc | () => void |
Returns: Promise<PluginListenerHandle>
Since: 8.0.0
addListener(eventName: 'smsRetrieverError', listenerFunc: (event: SmsRetrieverErrorEvent) => void) => Promise<PluginListenerHandle>
Listen for SMS Retriever runtime errors after {@link startWatch}.
| Param | Type |
|---|---|
eventName | 'smsRetrieverError' |
listenerFunc | (event: SmsRetrieverErrorEvent) => void |
Returns: Promise<PluginListenerHandle>
Since: 8.0.0
removeAllListeners() => Promise<void>
Remove all registered listeners for this plugin.
Since: 8.0.0
getPluginVersion() => Promise<PluginVersionResult>
Get the native Capacitor plugin version.
Returns: Promise<PluginVersionResult>
Since: 8.0.0
Result returned when SMS Retriever watching starts.
| Prop | Type | Description | Since |
|---|---|---|---|
status | SmsRetrieverStartStatus | Native status returned by Android. | 8.0.0 |
Result returned when SMS Retriever watching stops.
| Prop | Type | Description | Since |
|---|---|---|---|
status | 'SMS_RETRIEVER_DONE' | Native status returned by Android. | 8.0.0 |
Result returned by {@link AndroidSmsRetrieverPlugin.getHashString}.
| Prop | Type | Description | Since |
|---|---|---|---|
hash | string | The 11-character app hash that must be appended to verification SMS messages. | 8.0.0 |
Result returned by {@link AndroidSmsRetrieverPlugin.getPhoneNumber}.
| Prop | Type | Description | Since |
|---|---|---|---|
phoneNumber | string | Phone number selected by the user from Android's Phone Number Hint UI. | 8.0.0 |
| Prop | Type |
|---|---|
remove | () => Promise<void> |
SMS Retriever message event payload.
| Prop | Type | Description | Since |
|---|---|---|---|
message | string | Full verification SMS message received by Android's SMS Retriever API. | 8.0.0 |
SMS Retriever error event payload.
| Prop | Type | Description | Since |
|---|---|---|---|
message | string | Error message returned by Android or Google Play services. | 8.0.0 |
Plugin version payload.
| Prop | Type | Description | Since |
|---|---|---|---|
version | string | Version identifier returned by the platform implementation. | 8.0.0 |
Status values returned by {@link AndroidSmsRetrieverPlugin.startWatch}.
'SMS_RETRIEVER_STARTED' | 'SMS_RETRIEVER_ALREADY_STARTED'
FAQs
Capacitor plugin for Android SMS Retriever and Phone Number Hint APIs.
The npm package @capgo/capacitor-android-sms-retriever receives a total of 11,164 weekly downloads. As such, @capgo/capacitor-android-sms-retriever popularity was classified as popular.
We found that @capgo/capacitor-android-sms-retriever demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.

Research
/Security News
Malicious Chrome and Firefox extensions target Axiom Trade and Padre users, stealing session tokens and wallet data.

Security News
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.