Skip to main content

Android SMS Retriever Capacitor plugin

Read one app-targeted verification SMS without SMS permissions and request SIM phone number hints on Android

Install

bun add @capgo/capacitor-android-sms-retriever bunx cap sync
npm, pnpm or yarn
  • npm install @capgo/capacitor-android-sms-retriever
  • pnpm add @capgo/capacitor-android-sms-retriever
  • yarn add @capgo/capacitor-android-sms-retriever

Guide

How to use Android SMS Retriever in Capacitor

Test on device

Download the Capgo app, then scan the QR code.

Android SMS Retriever plugin preview QR code

Using @capgo/capacitor-android-sms-retriever

@capgo/capacitor-android-sms-retriever provides Android SMS Retriever and Phone Number Hint APIs for Capacitor apps.

Use it when you need passwordless phone verification without asking for SMS permissions. Android listens for one app-targeted verification SMS for up to five minutes and returns the message through Capacitor listeners.

Install

bun add @capgo/capacitor-android-sms-retriever
bunx cap sync android

What This Plugin Exposes

  • startWatch starts the Android SMS Retriever watch.
  • stopWatch stops the active watch.
  • getHashString returns the app hash required in verification SMS messages.
  • getPhoneNumber opens Android Phone Number Hint for SIM-based phone number selection.
  • smsReceived, smsRetrieverTimeout, and smsRetrieverError events cover the verification lifecycle.

Example Usage

import { AndroidSmsRetriever } from '@capgo/capacitor-android-sms-retriever';

const { hash } = await AndroidSmsRetriever.getHashString();
console.log('SMS hash:', hash);

await AndroidSmsRetriever.addListener('smsReceived', ({ message }) => {
  console.log('Verification SMS:', message);
});

await AndroidSmsRetriever.startWatch();

Phone Number Hint

const { phoneNumber } = await AndroidSmsRetriever.getPhoneNumber();
console.log(phoneNumber);

Full Reference

Keep going from Using @capgo/capacitor-android-sms-retriever

If you are using Using @capgo/capacitor-android-sms-retriever to plan native plugin work, connect it with @capgo/capacitor-android-sms-retriever for the implementation detail in @capgo/capacitor-android-sms-retriever, Getting Started for the implementation detail in Getting Started, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins.

FAQ

Android SMS Retriever plugin FAQ

How do I install the Android SMS Retriever plugin in a Capacitor app?

Run "bun add @capgo/capacitor-android-sms-retriever" (or "npm install @capgo/capacitor-android-sms-retriever"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-android-sms-retriever" in your app code.

Does @capgo/capacitor-android-sms-retriever work with React, Vue and Angular?

Yes. Android SMS Retriever is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-android-sms-retriever support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

Is @capgo/capacitor-android-sms-retriever free and open source?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-android-sms-retriever/ and the package is free to install from npm. Bug reports and pull requests are welcome.

Can I update code that uses Android SMS Retriever without an App Store review?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Ship Android SMS Retriever changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo