{"_id":"@capawesome/capacitor-silent-mode","_rev":"4-314b4535f4a51e6b55ca286a9f6dcf22","name":"@capawesome/capacitor-silent-mode","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.1":{"name":"@capawesome/capacitor-silent-mode","version":"0.0.1","keywords":["capacitor","plugin","native"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-silent-mode@0.0.1","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/plugins/silent-mode/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"9e59db46affee397183252dc89bce3ea1a225e55","tarball":"https://registry.npmjs.org/@capawesome/capacitor-silent-mode/-/capacitor-silent-mode-0.0.1.tgz","fileCount":36,"integrity":"sha512-mtuH9prg7VqhiuMVygMlGl8cQ9LTsgVNdCIPWWiWzFgvBIZjgkZ6HO9HTxgkKjodj0g4VUuMrk26j1Dsbj5yXw==","signatures":[{"sig":"MEQCIGUJ94oYroA7hNv1QPFRKN84jG1kQHlr1QAxcg0golqFAiBB2R8nEf4PoGCm5622AyMsEITO5KpTEW9PMz1q4eyw6w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51562},"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 SilentModePlugin --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 to detect whether the device is in silent mode.","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-silent-mode_0.0.1_1783405331004_0.3193043934598323","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@capawesome/capacitor-silent-mode","version":"0.1.0","keywords":["capacitor","plugin","native","capacitor-plugin","silent mode","ringer mode","mute switch","mute detection","vibrate mode","silent switch"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-silent-mode@0.1.0","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/silent-mode/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"a2719581cea98262b9608091fc273f71a7f00ddf","tarball":"https://registry.npmjs.org/@capawesome/capacitor-silent-mode/-/capacitor-silent-mode-0.1.0.tgz","fileCount":36,"integrity":"sha512-oHcWVvrHkvSpo2shlzeSY0vYFcOlAolhRENUzDKEDsDu4Eg4r94tUV0EZPLvxHG7Tsa5wCLHuLLFy4ws1BH4Nw==","signatures":[{"sig":"MEUCIHce58d7IwrGKqhj7ocmHOUllKwp0YOkGLH54vGeC8bhAiEA2S/1RkWjP0tP74adf7qlXPaE5aOaA8jLe10Z2RYQc5Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-silent-mode@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":56126},"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 SilentModePlugin --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:9bd11256-0ba7-4024-a905-064bfe019c5b"}},"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 to detect whether the device is in silent mode on Android and iOS.","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-silent-mode_0.1.0_1784015605762_0.14912212446733397","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@capawesome/capacitor-silent-mode","version":"0.1.1","keywords":["capacitor","plugin","native","capacitor-plugin","silent mode","ringer mode","mute switch","mute detection","vibrate mode","silent switch"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-silent-mode@0.1.1","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/silent-mode/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"8601e676aff0c9b230e046464ca6ce6042b20b9d","tarball":"https://registry.npmjs.org/@capawesome/capacitor-silent-mode/-/capacitor-silent-mode-0.1.1.tgz","fileCount":36,"integrity":"sha512-kt6ytKQi0mCGpRiECaBfnuV6j5hhrzg15a57rdpEUy8+WfX7jSbrxbA/wZw1P9wAa3mToDdM/fdhgHyvGkj/ew==","signatures":[{"sig":"MEUCIQDtyuRSbtoFF8rp1V/WZqutuGBsdSbNaXG4hqnu0plcSQIgZjzqUpDXksmbz8aSvi2lg8c+6TZHg615u4Vj+gMOyy4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-silent-mode@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":56135},"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 SilentModePlugin --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:9bd11256-0ba7-4024-a905-064bfe019c5b"}},"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 to detect whether the device is in silent mode on Android and iOS.","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-silent-mode_0.1.1_1784103059614_0.4308204105743445","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@capawesome/capacitor-silent-mode","version":"0.1.2","description":"Capacitor plugin to detect whether the device is in silent mode on Android and iOS.","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/silent-mode/","keywords":["capacitor","plugin","native","capacitor-plugin","silent mode","ringer mode","mute switch","mute detection","vibrate mode","silent switch"],"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 SilentModePlugin --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-silent-mode@0.1.2","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-X8Xxtca/vA8SV1LOLLmaiOdkVGwZVK/2B9BcOqmNuIQXswlrc0I5Vuj/PWWDii66sSaxT+k0Fw5uxGeK3nkB1g==","shasum":"45fc194db7b41014e82309af6264e005602cc050","tarball":"https://registry.npmjs.org/@capawesome/capacitor-silent-mode/-/capacitor-silent-mode-0.1.2.tgz","fileCount":36,"unpackedSize":56241,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-silent-mode@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDK+DLdJZdKcHKYc0lMBswCnjIIU9kvU4yuD1rwFPO0vwIhAKhYeULglvCYMEnUIyVGWF3K57L/lNI8UWd45mkPeqUI"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9bd11256-0ba7-4024-a905-064bfe019c5b"}},"directories":{},"maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/capacitor-silent-mode_0.1.2_1788337418687_0.48234815282701526"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-07T06:22:10.766Z","modified":"2026-09-02T08:23:39.131Z","0.0.1":"2026-07-07T06:22:11.117Z","0.1.0":"2026-07-14T07:53:25.929Z","0.1.1":"2026-07-15T08:10:59.856Z","0.1.2":"2026-09-02T08:23:38.799Z"},"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/silent-mode/","keywords":["capacitor","plugin","native","capacitor-plugin","silent mode","ringer mode","mute switch","mute detection","vibrate mode","silent switch"],"repository":{"type":"git","url":"git+https://github.com/capawesome-team/capacitor-plugins.git"},"description":"Capacitor plugin to detect whether the device is in silent mode on Android and iOS.","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"readme":"# Capacitor Silent Mode Plugin\n\nCapacitor plugin to detect whether the device is in silent mode.\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- 🔇 **Silent detection**: Check whether the device is currently in silent mode.\n- 🔔 **Ringer mode**: Read the exact ringer mode (normal, vibrate or silent) on Android.\n- 👂 **Change events**: Listen for changes to the silent mode state.\n- 🤝 **Compatibility**: Works alongside the [Audio Session](https://capawesome.io/docs/sdks/capacitor/audio-session/), [Haptics](https://capawesome.io/docs/sdks/capacitor/haptics/) and [Volume](https://capawesome.io/docs/sdks/capacitor/volume/) plugins.\n- 📦 **CocoaPods & SPM**: Supports CocoaPods and Swift Package Manager for iOS.\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 Silent Mode plugin is typically used to adapt an app's audio behavior to the device's ringer state, for example:\n\n- **Respect the mute switch**: Skip sound effects or in-app notification sounds while the device is in silent mode.\n- **Muted playback defaults**: Start audio or video content muted when the device is silent.\n- **Sound or vibration**: Use the exact ringer mode on Android to decide between playing a sound and vibrating.\n- **Live state updates**: React immediately when the user changes the silent mode state using the `silentModeChange` listener.\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-silent-mode` 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-silent-mode\nnpx cap sync\n```\n\nThis plugin is only available on **Android** and **iOS**. On the Web, all methods reject as unimplemented.\n\n## Configuration\n\nNo configuration required for this plugin.\n\n## Usage\n\nThe following examples show how to check whether the device is in silent mode, read the exact ringer mode, and listen for silent mode changes.\n\n### Check whether the device is in silent mode\n\nGet the current silent mode state of the device. On Android, the device is considered silent if the ringer mode is not set to normal (that is, either vibrate or silent). On iOS, the state is determined using a heuristic (see [Silent Mode Detection](#silent-mode-detection)). Only available on Android and iOS:\n\n```typescript\nimport { SilentMode } from '@capawesome/capacitor-silent-mode';\n\nconst isSilent = async () => {\n  const { silent } = await SilentMode.isSilent();\n  return silent;\n};\n```\n\n### Read the exact ringer mode\n\nRead the current ringer mode (`normal`, `vibrate` or `silent`), for example to distinguish between the vibrate and silent modes. Only available on Android:\n\n```typescript\nimport { SilentMode } from '@capawesome/capacitor-silent-mode';\n\nconst getRingerMode = async () => {\n  const { mode } = await SilentMode.getRingerMode();\n  return mode;\n};\n```\n\n### Listen for silent mode changes\n\nAttach a listener to be notified when the silent mode state changes. The device is only observed while at least one listener is attached. On iOS, the state is polled on a timer while the app is in the foreground:\n\n```typescript\nimport { SilentMode } from '@capawesome/capacitor-silent-mode';\n\nconst addSilentModeChangeListener = async () => {\n  await SilentMode.addListener('silentModeChange', event => {\n    console.log('Silent mode changed:', event.silent);\n  });\n};\n```\n\n### Stop listening for changes\n\nRemove all listeners when you no longer need to observe the silent mode state:\n\n```typescript\nimport { SilentMode } from '@capawesome/capacitor-silent-mode';\n\nconst removeAllListeners = async () => {\n  await SilentMode.removeAllListeners();\n};\n```\n\n## API\n\n<docgen-index>\n\n* [`getRingerMode()`](#getringermode)\n* [`isSilent()`](#issilent)\n* [`addListener('silentModeChange', ...)`](#addlistenersilentmodechange-)\n* [`removeAllListeners()`](#removealllisteners)\n* [Interfaces](#interfaces)\n* [Type Aliases](#type-aliases)\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### getRingerMode()\n\n```typescript\ngetRingerMode() => Promise<GetRingerModeResult>\n```\n\nGet the current ringer mode of the device.\n\nOnly available on Android.\n\n**Returns:** <code>Promise&lt;<a href=\"#getringermoderesult\">GetRingerModeResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### isSilent()\n\n```typescript\nisSilent() => Promise<IsSilentResult>\n```\n\nGet the current silent mode state of the device.\n\nOn Android, the device is considered silent if the ringer mode is not set\nto normal (that is, either vibrate or silent).\n\nOn iOS, there is no public API to read the ring/silent switch. The state is\ntherefore determined using a heuristic that plays a short muted system sound\nand measures how long it takes to complete. The result may be inaccurate\nwhile other audio is playing.\n\nOnly available on Android and iOS.\n\n**Returns:** <code>Promise&lt;<a href=\"#issilentresult\">IsSilentResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### addListener('silentModeChange', ...)\n\n```typescript\naddListener(eventName: 'silentModeChange', listenerFunc: (event: SilentModeChangeEvent) => void) => Promise<PluginListenerHandle>\n```\n\nListen for changes to the silent mode state of the device.\n\nThe device is only observed while at least one listener is attached.\n\nOn iOS, the state is polled on a timer while the app is in the foreground\nand the listener is not called while the app is in the background.\n\nOnly available on Android and iOS.\n\n| Param              | Type                                                                                        |\n| ------------------ | ------------------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'silentModeChange'</code>                                                             |\n| **`listenerFunc`** | <code>(event: <a href=\"#silentmodechangeevent\">SilentModeChangeEvent</a>) =&gt; void</code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#pluginlistenerhandle\">PluginListenerHandle</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### removeAllListeners()\n\n```typescript\nremoveAllListeners() => Promise<void>\n```\n\nRemove all listeners for this plugin.\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### Interfaces\n\n\n#### GetRingerModeResult\n\n| Prop       | Type                                              | Description                            | Since |\n| ---------- | ------------------------------------------------- | -------------------------------------- | ----- |\n| **`mode`** | <code><a href=\"#ringermode\">RingerMode</a></code> | The current ringer mode of the device. | 0.1.0 |\n\n\n#### IsSilentResult\n\n| Prop         | Type                 | Description                                     | Since |\n| ------------ | -------------------- | ----------------------------------------------- | ----- |\n| **`silent`** | <code>boolean</code> | Whether the device is currently in silent mode. | 0.1.0 |\n\n\n#### PluginListenerHandle\n\n| Prop         | Type                                      |\n| ------------ | ----------------------------------------- |\n| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |\n\n\n#### SilentModeChangeEvent\n\n| Prop         | Type                 | Description                                     | Since |\n| ------------ | -------------------- | ----------------------------------------------- | ----- |\n| **`silent`** | <code>boolean</code> | Whether the device is currently in silent mode. | 0.1.0 |\n\n\n### Type Aliases\n\n\n#### RingerMode\n\nThe ringer mode of the device.\n\n- `normal`: The device plays sounds and rings for incoming calls.\n- `silent`: The device is silent and does not vibrate.\n- `vibrate`: The device is silent but vibrates.\n\n<code>'normal' | 'silent' | 'vibrate'</code>\n\n</docgen-api>\n\n## Silent Mode Detection\n\nKeep the following platform differences in mind when detecting silent mode:\n\n- **Android**: The silent mode state is derived from the [ringer mode](https://developer.android.com/reference/android/media/AudioManager#getRingerMode()). A device is considered silent whenever the ringer mode is not `normal`, which means that the vibrate mode also counts as silent. Use `getRingerMode()` if you need to distinguish between the vibrate and silent modes.\n- **iOS**: There is no public API to read the state of the ring/silent switch. The plugin therefore relies on a heuristic that plays a short muted system sound and measures how long it takes to complete. As a result, the detection may be inaccurate while other audio is playing or when the audio session category overrides the switch. The `silentModeChange` listener polls this heuristic on a timer while the app is in the foreground and pauses while the app is in the background.\n\n## FAQ\n\n### How is this plugin different from other similar plugins?\n\nIt reports whether the device is in silent mode on both Android and iOS, and on Android it also exposes the exact ringer mode so you can distinguish vibrate from fully silent. A `silentModeChange` listener lets you react the moment the state changes, and the device is only observed while a listener is attached. Everything is delivered through a fully typed API that supports CocoaPods and Swift Package Manager on iOS and tracks the latest Capacitor version.\n\n### How does silent mode detection work on iOS?\n\niOS provides no public API to read the state of the ring/silent switch. The plugin therefore relies on a heuristic that plays a short muted system sound and measures how long it takes to complete. As a result, the detection may be inaccurate while other audio is playing or when the audio session category overrides the switch. See [Silent Mode Detection](#silent-mode-detection) for details.\n\n### Why is vibrate mode reported as silent on Android?\n\nOn Android, the device is considered silent whenever the ringer mode is not set to normal, which includes both the vibrate and silent modes. If you need to distinguish between them, use the `getRingerMode` method, which returns the exact ringer mode. This method is only available on Android.\n\n### Can I detect silent mode changes while the app is in the background?\n\nOn iOS, no. The `silentModeChange` listener polls the silent mode state on a timer while the app is in the foreground and pauses while the app is in the background. Also note that the device is only observed while at least one listener is attached.\n\n### Is the Silent Mode plugin available on the Web?\n\nNo, the plugin is only available on Android and iOS. On the Web, all methods reject as unimplemented, since browsers do not expose the device's ringer state.\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- [Audio Session](https://capawesome.io/docs/sdks/capacitor/audio-session/): Configure and observe the iOS audio session.\n- [Haptics](https://capawesome.io/docs/sdks/capacitor/haptics/): Provide haptic feedback such as impacts, notifications, and vibrations.\n- [Volume](https://capawesome.io/docs/sdks/capacitor/volume/): Control the volume and observe hardware volume button presses.\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/silent-mode/CHANGELOG.md).\n\n## License\n\nSee [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/silent-mode/LICENSE).\n","readmeFilename":"README.md"}