{"_id":"@capawesome/capacitor-android-sms-retriever","_rev":"4-db63738d5a844b5c3bd37d089bd4aa16","name":"@capawesome/capacitor-android-sms-retriever","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.1":{"name":"@capawesome/capacitor-android-sms-retriever","version":"0.0.1","keywords":["capacitor","plugin","native"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-android-sms-retriever@0.0.1","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/plugins/android-sms-retriever/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"ec8764b3c352dff05f1c6710ab30743ead388488","tarball":"https://registry.npmjs.org/@capawesome/capacitor-android-sms-retriever/-/capacitor-android-sms-retriever-0.0.1.tgz","fileCount":34,"integrity":"sha512-WF3Pwlq8yeTGlckLK98k7F5LW6jyKhkctM0/L++rs1arQ/HUGbyF6pX17QcxMdRXKaYgmgUslpe3mlgnMjqH4g==","signatures":[{"sig":"MEUCIELArIs1rH3DMZDlPYwhHpQ2oLZkQhHz0QEU9RriG1PbAiEAsRbkn3JaabPESdwAjqkj2jJD2zVAQqEkSg5o4QlDelY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57238},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","funding":[{"url":"https://github.com/sponsors/capawesome-team/","type":"github"},{"url":"https://opencollective.com/capawesome","type":"opencollective"}],"gitHead":"8dd31ce5d3f16f94fb71d033f47512e99908f4e4","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api AndroidSmsRetrieverPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd .."},"_npmUser":{"name":"robingenz","email":"mail@robingenz.dev"},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"repository":{"url":"git+https://github.com/capawesome-team/capacitor-plugins.git","type":"git"},"_npmVersion":"11.13.0","description":"Capacitor plugin for OTP autofill on Android via the SMS User Consent and Phone Number Hint APIs.","directories":{},"_nodeVersion":"24.16.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.1.2","rollup":"4.53.3","swiftlint":"2.0.0","typescript":"5.9.3","@capacitor/cli":"8.0.0","@capacitor/ios":"8.0.0","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/android":"8.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.6.7"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-android-sms-retriever_0.0.1_1783405201902_0.3349279609453262","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@capawesome/capacitor-android-sms-retriever","version":"0.1.0","keywords":["capacitor","capacitor-plugin","plugin","native","android","sms retriever","otp","otp autofill","one-time code","sms verification","sms user consent","phone number hint","phone verification"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-android-sms-retriever@0.1.0","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/android-sms-retriever/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"8ff1ae2741a2d8ac879471235adf0a3ee85acddb","tarball":"https://registry.npmjs.org/@capawesome/capacitor-android-sms-retriever/-/capacitor-android-sms-retriever-0.1.0.tgz","fileCount":34,"integrity":"sha512-0bjGnKIYekzJQ9G9PANfxsXPJSvtpFU4VDPJqhoDvrj8pJ8JfSwJVbRJ0ux/Z024j3TE46Xt3qNHKJr3IUFACw==","signatures":[{"sig":"MEQCIEZLvP5J2LrDEFxW8QFSse+j4lpvr4Wo+TgLoed7C95gAiB/8CMw9zjerpzFc2bOLNizVtm5GLZv1kxL/sQ4vHDItg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-android-sms-retriever@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":61789},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","funding":[{"url":"https://github.com/sponsors/capawesome-team/","type":"github"},{"url":"https://opencollective.com/capawesome","type":"opencollective"}],"gitHead":"1ce17b1fd14c43b2f1d5d3c2da82221e1d1dca37","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api AndroidSmsRetrieverPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd .."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2939c801-8110-4355-b6a3-dd9851eea443"}},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"repository":{"url":"git+https://github.com/capawesome-team/capacitor-plugins.git","type":"git"},"_npmVersion":"11.16.0","description":"Capacitor plugin for OTP autofill on Android via the SMS User Consent and Phone Number Hint APIs.","directories":{},"_nodeVersion":"24.18.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.1.2","rollup":"4.53.3","swiftlint":"2.0.0","typescript":"5.9.3","@capacitor/cli":"8.0.0","@capacitor/ios":"8.0.0","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/android":"8.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.6.7"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-android-sms-retriever_0.1.0_1784015488682_0.9015512440921987","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@capawesome/capacitor-android-sms-retriever","version":"0.1.1","keywords":["capacitor","capacitor-plugin","plugin","native","android","sms retriever","otp","otp autofill","one-time code","sms verification","sms user consent","phone number hint","phone verification"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-android-sms-retriever@0.1.1","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/android-sms-retriever/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"6a73bb9caf0da3b0b82a80fc2a5738c4554849d0","tarball":"https://registry.npmjs.org/@capawesome/capacitor-android-sms-retriever/-/capacitor-android-sms-retriever-0.1.1.tgz","fileCount":34,"integrity":"sha512-zyET9fhasHOW1S1XkyxHm501zeTJDjubXEDC3kMT+QnRBJwdEXkfjoSiM8WGGvTtxWLQjuWwVx2R0aT7O/WRZA==","signatures":[{"sig":"MEUCIQCXuHKeZmgRGu5pFEgVlzPI5T/li+J9s/iHfMGqN7NzkwIgOK4+7rVNBu5o65OWP5mG6PfObdg9PfGQgSchABWgnEg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-android-sms-retriever@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":61798},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","funding":[{"url":"https://github.com/sponsors/capawesome-team/","type":"github"},{"url":"https://opencollective.com/capawesome","type":"opencollective"}],"gitHead":"3e61f4b412f9f3f512c21169bb135bbb23a67e6d","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api AndroidSmsRetrieverPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd .."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2939c801-8110-4355-b6a3-dd9851eea443"}},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"repository":{"url":"git+https://github.com/capawesome-team/capacitor-plugins.git","type":"git"},"_npmVersion":"11.16.0","description":"Capacitor plugin for OTP autofill on Android via the SMS User Consent and Phone Number Hint APIs.","directories":{},"_nodeVersion":"24.18.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.1.2","rollup":"4.53.3","swiftlint":"2.0.0","typescript":"5.9.3","@capacitor/cli":"8.0.0","@capacitor/ios":"8.0.0","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/android":"8.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.6.7"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-android-sms-retriever_0.1.1_1784102941179_0.16889656615811166","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@capawesome/capacitor-android-sms-retriever","version":"0.1.2","description":"Capacitor plugin for OTP autofill on Android via the SMS User Consent and Phone Number Hint APIs.","main":"dist/plugin.cjs.js","module":"dist/esm/index.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/capawesome-team/capacitor-plugins.git"},"bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"funding":[{"type":"github","url":"https://github.com/sponsors/capawesome-team/"},{"type":"opencollective","url":"https://opencollective.com/capawesome"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/android-sms-retriever/","keywords":["capacitor","capacitor-plugin","plugin","native","android","sms retriever","otp","otp autofill","one-time code","sms verification","sms user consent","phone number hint","phone verification"],"scripts":{"verify":"npm run verify:ios && npm run verify:android && npm run verify:web","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:android":"cd android && ./gradlew clean build test && cd ..","verify:web":"npm run build","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","eslint":"eslint . --ext ts","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","docgen":"docgen --api AndroidSmsRetrieverPlugin --output-readme README.md --output-json dist/docs.json","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd ..","prepublishOnly":"npm run build"},"devDependencies":{"@capacitor/android":"8.0.0","@capacitor/cli":"8.4.2","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/ios":"8.0.0","@ionic/eslint-config":"0.4.0","eslint":"8.57.0","prettier-plugin-java":"2.9.7","rimraf":"6.1.2","rollup":"4.62.3","swiftlint":"2.0.0","typescript":"5.9.3"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"publishConfig":{"access":"public"},"gitHead":"7c1937ed10b7de86ca2c1cdc3539a2735fd69a00","_id":"@capawesome/capacitor-android-sms-retriever@0.1.2","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-61nbscy0s0YEvmw4CFctR0yiZtDwO+rJhzqWYIIlQzoVze58jkHVQfCmiAxdUYzvgqWm8t5+FiSIIdvl1XIGhQ==","shasum":"48e9226c2bd276b7dc87ad49f43737e39b9d5c23","tarball":"https://registry.npmjs.org/@capawesome/capacitor-android-sms-retriever/-/capacitor-android-sms-retriever-0.1.2.tgz","fileCount":34,"unpackedSize":61940,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-android-sms-retriever@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDm9BtTAIYgsSlfxV9JYPVeYlSvHYaQrgE7tq6mR2DrHwIgUJhgtxLrLXaPLfH3GKFF/swJa99pCXCgRtVAwy4bwBU="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2939c801-8110-4355-b6a3-dd9851eea443"}},"directories":{},"maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/capacitor-android-sms-retriever_0.1.2_1788337292277_0.5432619176617464"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-07T06:20:01.770Z","modified":"2026-09-02T08:21:32.710Z","0.0.1":"2026-07-07T06:20:02.051Z","0.1.0":"2026-07-14T07:51:28.820Z","0.1.1":"2026-07-15T08:09:01.322Z","0.1.2":"2026-09-02T08:21:32.404Z"},"bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","homepage":"https://capawesome.io/docs/sdks/capacitor/android-sms-retriever/","keywords":["capacitor","capacitor-plugin","plugin","native","android","sms retriever","otp","otp autofill","one-time code","sms verification","sms user consent","phone number hint","phone verification"],"repository":{"type":"git","url":"git+https://github.com/capawesome-team/capacitor-plugins.git"},"description":"Capacitor plugin for OTP autofill on Android via the SMS User Consent and Phone Number Hint APIs.","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"readme":"# Capacitor Android SMS Retriever Plugin\n\nCapacitor plugin for OTP autofill on Android via the SMS User Consent and Phone Number Hint APIs.\n\n<div class=\"capawesome-z29o10a\">\n  <a href=\"https://cloud.capawesome.io/\" target=\"_blank\">\n    <img alt=\"Deliver Live Updates to your Capacitor app with Capawesome Cloud\" src=\"https://cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png?t=1\" />\n  </a>\n</div>\n\n## Features\n\n- 💬 **SMS User Consent**: Read an incoming verification SMS after a one-tap system consent dialog.\n- 📞 **Phone Number Hint**: Prefill the user's phone number via the system bottom sheet.\n- 🔒 **No SMS permissions**: Uses Play-policy-safe APIs that require no SMS permissions.\n- 🤝 **Compatibility**: Works alongside the [Password Autofill](https://capawesome.io/docs/sdks/capacitor/password-autofill/), [SIM](https://capawesome.io/docs/sdks/capacitor/sim/) and [SMS Composer](https://capawesome.io/docs/sdks/capacitor/sms-composer/) plugins.\n- 🔁 **Up-to-date**: Always supports the latest Capacitor version.\n\nMissing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!\n\n## Use Cases\n\nThe Android SMS Retriever plugin is typically used in phone number verification flows, for example:\n\n- **OTP autofill**: Retrieve an incoming verification SMS after a one-tap system consent dialog and extract the one-time code, so the user doesn't have to type it manually.\n- **Phone number prefill**: Prefill the phone number input field of your sign-up or login form via the system bottom sheet.\n- **Play-policy-safe SMS verification**: Implement SMS-based verification without requesting any SMS permissions, using the SMS User Consent and Phone Number Hint APIs.\n\n## Compatibility\n\n| Plugin Version | Capacitor Version | Status         |\n| -------------- | ----------------- | -------------- |\n| 0.x.x          | >=8.x.x           | Active support |\n\n## Installation\n\nYou can use our **AI-Assisted Setup** to install the plugin.\nAdd the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:\n\n```bash\nnpx skills add capawesome-team/skills --skill capacitor-plugins\n```\n\nThen use the following prompt:\n\n```\n Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-android-sms-retriever` plugin in my project.\n```\n\nIf you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:\n\n```bash\nnpm install @capawesome/capacitor-android-sms-retriever\nnpx cap sync\n```\n\nThis plugin is only available on **Android**. On iOS and Web, all methods reject as unimplemented (see [iOS](#ios) below).\n\n### Android\n\n#### Variables\n\nThis plugin will use the following project variables (defined in your app's `variables.gradle` file):\n\n- `$playServicesAuthVersion` version of `com.google.android.gms:play-services-auth` (default: `21.5.0`)\n- `$playServicesAuthApiPhoneVersion` version of `com.google.android.gms:play-services-auth-api-phone` (default: `18.3.0`)\n\n### iOS\n\nThis plugin has **no iOS implementation** and you don't need one. iOS already autofills one-time codes from incoming SMS messages in `WKWebView` when the input field uses `autocomplete=\"one-time-code\"`:\n\n```html\n<input autocomplete=\"one-time-code\" />\n```\n\nAll methods reject as unimplemented on iOS.\n\n## Configuration\n\nNo configuration required for this plugin.\n\n## Usage\n\nThe following examples show how to prefill the user's phone number and retrieve a verification SMS.\n\n### Prefill the user's phone number\n\nRequest the user's phone number via the Phone Number Hint API. A system bottom sheet is displayed that lets the user pick one of the phone numbers associated with the device, for example to prefill a phone number input field. Only available on Android:\n\n```typescript\nimport { AndroidSmsRetriever } from '@capawesome/capacitor-android-sms-retriever';\n\nconst requestPhoneNumber = async () => {\n  const { phoneNumber } = await AndroidSmsRetriever.requestPhoneNumber();\n  return phoneNumber;\n};\n```\n\n### Retrieve a verification SMS\n\nRetrieve an incoming verification SMS via the SMS User Consent API. A system consent dialog is displayed when a matching SMS is received, and the promise resolves with the full message text once the user consents, so your app can extract the one-time code itself (see [Extracting the One-Time Code](#extracting-the-one-time-code)). Only available on Android:\n\n```typescript\nimport { AndroidSmsRetriever } from '@capawesome/capacitor-android-sms-retriever';\n\nconst retrieveSms = async () => {\n  const { message } = await AndroidSmsRetriever.retrieveSms();\n  // Extract the one-time code from the message.\n  const code = message.match(/\\d{6}/)?.[0];\n  return code;\n};\n```\n\n## API\n\n<docgen-index>\n\n* [`requestPhoneNumber()`](#requestphonenumber)\n* [`retrieveSms(...)`](#retrievesms)\n* [Interfaces](#interfaces)\n\n</docgen-index>\n\n<docgen-api>\n<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->\n\n### requestPhoneNumber()\n\n```typescript\nrequestPhoneNumber() => Promise<RequestPhoneNumberResult>\n```\n\nRequest the user's phone number via the Phone Number Hint API.\n\nA system bottom sheet is displayed that lets the user pick one of the\nphone numbers associated with the device. The selected phone number is\nreturned so it can be used to prefill a phone number input field.\n\nOnly available on Android.\n\n**Returns:** <code>Promise&lt;<a href=\"#requestphonenumberresult\">RequestPhoneNumberResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### retrieveSms(...)\n\n```typescript\nretrieveSms(options?: RetrieveSmsOptions | undefined) => Promise<RetrieveSmsResult>\n```\n\nRetrieve an incoming verification SMS via the SMS User Consent API.\n\nA system consent dialog is displayed when a matching SMS is received.\nThe promise resolves with the full message text once the user consents,\nso the app can extract the one-time code itself.\n\nThe underlying broadcast waits up to 5 minutes for a matching SMS. If no\nSMS is received within this time, the promise rejects with the error\ncode `TIMEOUT`.\n\nOnly available on Android.\n\n| Param         | Type                                                              |\n| ------------- | ----------------------------------------------------------------- |\n| **`options`** | <code><a href=\"#retrievesmsoptions\">RetrieveSmsOptions</a></code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#retrievesmsresult\">RetrieveSmsResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### Interfaces\n\n\n#### RequestPhoneNumberResult\n\n| Prop              | Type                | Description                            | Since |\n| ----------------- | ------------------- | -------------------------------------- | ----- |\n| **`phoneNumber`** | <code>string</code> | The phone number selected by the user. | 0.1.0 |\n\n\n#### RetrieveSmsResult\n\n| Prop          | Type                | Description                                                                                                           | Since |\n| ------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------- | ----- |\n| **`message`** | <code>string</code> | The full text of the retrieved SMS message. The app is responsible for extracting the one-time code from the message. | 0.1.0 |\n\n\n#### RetrieveSmsOptions\n\n| Prop                    | Type                | Description                                                                                                           | Since |\n| ----------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------- | ----- |\n| **`senderPhoneNumber`** | <code>string</code> | The phone number of the sender to filter incoming messages by. If not provided, the SMS from any sender is retrieved. | 0.1.0 |\n\n</docgen-api>\n\n## Extracting the One-Time Code\n\nThe `retrieveSms(...)` method resolves with the full text of the incoming SMS message. Your app is responsible for extracting the one-time code from the message, for example with a regular expression:\n\n```typescript\nconst { message } = await AndroidSmsRetriever.retrieveSms();\nconst code = message.match(/\\d{6}/)?.[0];\n```\n\nFor the SMS User Consent API to detect a message, the SMS must:\n\n- contain a one-time code that the user sends back to your server to complete the verification,\n- be no longer than 140 bytes,\n- not originate from a phone number in the user's contacts.\n\nThe underlying broadcast waits up to 5 minutes for a matching SMS. If no message is received within this time, the promise rejects with the error code `TIMEOUT`.\n\n## FAQ\n\n### How is this plugin different from other similar plugins?\n\nIt implements OTP autofill on Android through the SMS User Consent and Phone Number Hint APIs, so you can read a verification SMS and prefill the user's phone number without requesting any SMS permissions and while staying within Google Play policy. It's a focused, fully typed API that handles the system consent dialog and bottom sheet for you, and it's actively maintained against the latest Capacitor and Android versions. On iOS you don't need it at all — the WebView already autofills one-time codes — and the README explains exactly how.\n\n### Does this plugin require any SMS permissions?\n\nNo, the plugin uses the SMS User Consent and Phone Number Hint APIs, which are Play-policy-safe and require no SMS permissions. Instead of reading SMS messages silently, the user explicitly consents via a one-tap system dialog before your app receives the message.\n\n### Does this plugin work on iOS or Web?\n\nNo, this plugin only provides an Android implementation and you don't need one on iOS. iOS already autofills one-time codes from incoming SMS messages in `WKWebView` when the input field uses `autocomplete=\"one-time-code\"`. On iOS and Web, all methods reject as unimplemented.\n\n### Why does `retrieveSms` reject with the error code `TIMEOUT`?\n\nThe underlying broadcast waits up to 5 minutes for a matching SMS. If no matching message is received within this time, the promise rejects with the error code `TIMEOUT`. Make sure the SMS is sent while the broadcast is active and meets the requirements of the SMS User Consent API.\n\n### Why is my SMS message not detected?\n\nFor the SMS User Consent API to detect a message, the SMS must contain a one-time code that the user sends back to your server to complete the verification, be no longer than 140 bytes, and not originate from a phone number in the user's contacts. See [Extracting the One-Time Code](#extracting-the-one-time-code) for more information.\n\n### Can I filter incoming messages by sender?\n\nYes, you can pass the `senderPhoneNumber` option to the `retrieveSms(...)` method to only retrieve messages from a specific sender. If not provided, the SMS from any sender is retrieved.\n\n### Can I use this plugin with Ionic, React, Vue or Angular?\n\nYes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.\n\n## Related Plugins\n\n- [Password Autofill](https://capawesome.io/docs/sdks/capacitor/password-autofill/): Save passwords to the platform credential store.\n- [SIM](https://capawesome.io/docs/sdks/capacitor/sim/): Read SIM card and carrier information.\n- [SMS Composer](https://capawesome.io/docs/sdks/capacitor/sms-composer/): Open the native SMS composer prefilled with recipients and a message body.\n\n## Newsletter\n\nStay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).\n\n## Changelog\n\nSee [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/android-sms-retriever/CHANGELOG.md).\n\n## License\n\nSee [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/android-sms-retriever/LICENSE).\n","readmeFilename":"README.md"}