Skip to content

@capgo/capacitor-android-sms-retriever

Read one app targeted SMS OTP on Android without SMS permissions.

Start the retriever, listen for smsReceived, extract the numeric OTP from the SMS body, and verify the trailing 11 character app hash your server appends for the Retriever API.

PlatformSupportNotes
iOSNoUse autofill or passkeys
AndroidYesSMS Retriever API
WebNoNot applicable
  • 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.
PlatformSupport
AndroidSupported
iOSUnsupported stub
WebUnsupported stub
MethodDescription
startWatchStart listening for one verification SMS.
stopWatchStop the active watch.
getHashStringReturn the 11-character app hash.
getPhoneNumberShow 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.
getPluginVersionReturn the native plugin version.

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.