{"_id":"@capawesome/capacitor-flic","_rev":"3-f946e298ebb07f98e1fe0195429dd735","name":"@capawesome/capacitor-flic","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.0":{"name":"@capawesome/capacitor-flic","version":"0.0.0","keywords":["capacitor","plugin","native","flic","flic2","flic-button","capacitor-plugin","smart button","shortcut labs","bluetooth button","ble","iot"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-flic@0.0.0","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/flic/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"baa205d4430cb650ceabb2b496ba6f016c34be6b","tarball":"https://registry.npmjs.org/@capawesome/capacitor-flic/-/capacitor-flic-0.0.0.tgz","fileCount":105,"integrity":"sha512-ypz/XUB6E1b8lIVTSDKriMS3JTkfjWdHAVexPUpoV/MgzD1hSpiG8WM4murPdQAosGNlUcM4DPiYWmplGrbcUA==","signatures":[{"sig":"MEYCIQDYj6LUhNaWtqlpuy39Lt3nuDjTXbi8UsB9i4TPeeztggIhALRML8ArI/lfURCPk+yJTvTc6vtXtuLLnPRQWXXq8jXo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15492765},"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":"e542edf64427eff0cbdc6bc04706e0a0abe3ccd3","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 FlicPlugin --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":"Unofficial Capacitor plugin for Flic smart buttons on Android and iOS.","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.62.3","swiftlint":"2.0.0","typescript":"5.9.3","@capacitor/cli":"8.4.2","@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.9.7"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-flic_0.0.0_1788155385459_0.9706292196696684","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@capawesome/capacitor-flic","version":"0.1.0","keywords":["capacitor","plugin","native","flic","flic2","flic-button","capacitor-plugin","smart button","shortcut labs","bluetooth button","ble","iot"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-flic@0.1.0","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/flic/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"d36416830e623c3b6e7bd6ecb003ea3230d2b04f","tarball":"https://registry.npmjs.org/@capawesome/capacitor-flic/-/capacitor-flic-0.1.0.tgz","fileCount":105,"integrity":"sha512-8q9mTwn//Efr+oFPrC344TpZj6YOMdZFC65f+nJhGWRuf5LZDbt/IZCDLChrBqxsy/781LPbs8F9RIshLBGjfg==","signatures":[{"sig":"MEUCIQCBl1+3JETF0QHoqAB5xlen1qi5LFAunhgbfBxH1VJT5gIgFpGr2Ww2Cd1vfJd4atcd4Ds4qbd8onPbhhjQE33R+5M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-flic@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15492765},"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":"c74899aebe26f765d43b6f9e3161089fcb236f60","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 FlicPlugin --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:8141d81e-36e4-4974-975e-c22073e0b6ad"}},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"repository":{"url":"git+https://github.com/capawesome-team/capacitor-plugins.git","type":"git"},"_npmVersion":"11.17.0","description":"Unofficial Capacitor plugin for Flic smart buttons on Android and iOS.","directories":{},"_nodeVersion":"24.19.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.1.2","rollup":"4.62.3","swiftlint":"2.0.0","typescript":"5.9.3","@capacitor/cli":"8.4.2","@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.9.7"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-flic_0.1.0_1788155766883_0.05129133987273882","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@capawesome/capacitor-flic","version":"0.1.1","description":"Unofficial Capacitor plugin for Flic smart buttons 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/flic/","keywords":["capacitor","plugin","native","flic","flic2","flic-button","capacitor-plugin","smart button","shortcut labs","bluetooth button","ble","iot"],"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 FlicPlugin --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-flic@0.1.1","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-d3nxopciF6FsDgzv5gUQofSNBirCBEfKdI36KIzcWeoyBcSd4BgxqtKz6Zzcm0oXLIRWSKms5oY6ZcsbJFdKlw==","shasum":"8276d1d8af0454ff0eab6c66ba0626caa6c6d282","tarball":"https://registry.npmjs.org/@capawesome/capacitor-flic/-/capacitor-flic-0.1.1.tgz","fileCount":105,"unpackedSize":15492627,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-flic@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGtd7uMK4PQIhWTCwZ9BP6flMd7tMr/d7tV+uwFejxGQAiB3OjOwHg3QEtdTeCKv2rDLyc9PKPocfm6d82TJoKUyzw=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8141d81e-36e4-4974-975e-c22073e0b6ad"}},"directories":{},"maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/capacitor-flic_0.1.1_1788337349260_0.7376146466419271"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-31T05:49:45.280Z","modified":"2026-09-02T08:22:29.805Z","0.0.0":"2026-08-31T05:49:45.729Z","0.1.0":"2026-08-31T05:56:07.094Z","0.1.1":"2026-09-02T08:22:29.497Z"},"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/flic/","keywords":["capacitor","plugin","native","flic","flic2","flic-button","capacitor-plugin","smart button","shortcut labs","bluetooth button","ble","iot"],"repository":{"type":"git","url":"git+https://github.com/capawesome-team/capacitor-plugins.git"},"description":"Unofficial Capacitor plugin for Flic smart buttons on Android and iOS.","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"readme":"# Capacitor Flic Plugin\n\nUnofficial Capacitor plugin for [Flic](https://flic.io/) smart buttons.[^1]\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- 🔍 **Pairing wizard**: Pair new Flic buttons with a single call using the integrated scan wizard.\n- 🔗 **Connection management**: Connect, disconnect and forget buttons at any time.\n- 🖱️ **Button events**: Listen for single click, double click, hold, down and up events.\n- 📥 **Queued events**: Receive events that occurred while the button was disconnected.\n- 🔋 **Battery level**: Read the last known battery voltage of each button.\n- 🔐 **Permissions**: Check and request the required permissions with a single call.\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 Flic plugin is typically used to trigger app actions with a physical button, for example:\n\n- **Smart home control**: Toggle lights, scenes or other devices with a single press.\n- **Safety buttons**: Send an alert or start a call when the user presses the button.\n- **Time tracking**: Start and stop timers without opening the app.\n- **Accessibility**: Provide a simple physical trigger for essential app actions.\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-flic` 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-flic\nnpx cap sync\n```\n\n### Android\n\nThe plugin already declares all required Bluetooth permissions in its manifest, so no additional configuration is required.\n\nThe [flic2lib-android](https://github.com/50ButtonsEach/flic2lib-android) library is resolved from [JitPack](https://jitpack.io/). The plugin already declares the JitPack repository in its `build.gradle` file. If your project restricts repository declarations to the settings file (e.g. via `dependencyResolutionManagement` with `FAIL_ON_PROJECT_REPOS`), add the JitPack repository to your `settings.gradle` file:\n\n```groovy\ndependencyResolutionManagement {\n    repositories {\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n#### Variables\n\nThis plugin will use the following project variables (defined in your app’s `variables.gradle` file):\n\n- `$flic2libVersion` version of `com.github.50ButtonsEach:flic2lib-android` (default: `2.0.1`)\n\n### iOS\n\nAdd the `NSBluetoothAlwaysUsageDescription` and `NSBluetoothPeripheralUsageDescription` keys to the `ios/App/App/Info.plist` file, which tells the user why the app needs access to Bluetooth:\n\n```xml\n<key>NSBluetoothAlwaysUsageDescription</key>\n<string>The app needs access to Bluetooth to communicate with your Flic buttons.</string>\n<key>NSBluetoothPeripheralUsageDescription</key>\n<string>The app needs access to Bluetooth to communicate with your Flic buttons.</string>\n```\n\nIf you want to receive button events while the app is in the background, you must also enable the `Uses Bluetooth LE accessories` background mode in the **Signing & Capabilities** section of your Xcode project and call `initialize(...)` with the `iosBackground` option set to `true`.\n\n## Configuration\n\nNo configuration required for this plugin.\n\n## Usage\n\n### Initialize the plugin\n\nCall `initialize()` as soon as possible after the app has launched to minimize the delay of any pending button events:\n\n```typescript\nimport { Flic } from '@capawesome/capacitor-flic';\n\nconst initialize = async () => {\n  await Flic.initialize({ iosBackground: true });\n};\n```\n\n### Pair a new button\n\nTo pair a new button, start a scan and press and hold the button for at least 6 seconds:\n\n```typescript\nimport { Flic, ScanStatus } from '@capawesome/capacitor-flic';\n\nconst pairButton = async () => {\n  await Flic.addListener('scanStatusChanged', (event) => {\n    if (event.status === ScanStatus.Discovered) {\n      console.log('Button discovered. Keep holding it...');\n    }\n  });\n  const { button } = await Flic.startScan();\n  return button;\n};\n```\n\n### List paired buttons\n\n```typescript\nimport { Flic } from '@capawesome/capacitor-flic';\n\nconst getButtons = async () => {\n  const { buttons } = await Flic.getButtons();\n  return buttons;\n};\n```\n\n### Connect a button\n\nAfter an app restart, each paired button must be connected again:\n\n```typescript\nimport { Flic } from '@capawesome/capacitor-flic';\n\nconst connectButtons = async () => {\n  const { buttons } = await Flic.getButtons();\n  for (const button of buttons) {\n    await Flic.connectButtonById({ id: button.id });\n  }\n};\n```\n\n### Listen for button events\n\n```typescript\nimport { Flic } from '@capawesome/capacitor-flic';\n\nconst addListeners = async () => {\n  await Flic.addListener('buttonSingleClick', (event) => {\n    console.log('Button was clicked', event);\n  });\n  await Flic.addListener('buttonDoubleClick', (event) => {\n    console.log('Button was double clicked', event);\n  });\n  await Flic.addListener('buttonHold', (event) => {\n    console.log('Button was held down', event);\n  });\n};\n```\n\n### Forget a button\n\n```typescript\nimport { Flic } from '@capawesome/capacitor-flic';\n\nconst forgetButton = async (id: string) => {\n  await Flic.forgetButtonById({ id });\n};\n```\n\n### Check and request permissions\n\n```typescript\nimport { Flic } from '@capawesome/capacitor-flic';\n\nconst checkPermissions = async () => {\n  const permissionStatus = await Flic.checkPermissions();\n  return permissionStatus;\n};\n\nconst requestPermissions = async () => {\n  const permissionStatus = await Flic.requestPermissions();\n  return permissionStatus;\n};\n```\n\n## API\n\n<docgen-index>\n\n* [`checkPermissions()`](#checkpermissions)\n* [`connectButtonById(...)`](#connectbuttonbyid)\n* [`disconnectButtonById(...)`](#disconnectbuttonbyid)\n* [`forgetButtonById(...)`](#forgetbuttonbyid)\n* [`getButtons()`](#getbuttons)\n* [`initialize(...)`](#initialize)\n* [`requestPermissions()`](#requestpermissions)\n* [`startScan()`](#startscan)\n* [`stopScan()`](#stopscan)\n* [`addListener('buttonConnected', ...)`](#addlistenerbuttonconnected-)\n* [`addListener('buttonConnectionFailed', ...)`](#addlistenerbuttonconnectionfailed-)\n* [`addListener('buttonDisconnected', ...)`](#addlistenerbuttondisconnected-)\n* [`addListener('buttonDoubleClick', ...)`](#addlistenerbuttondoubleclick-)\n* [`addListener('buttonDown', ...)`](#addlistenerbuttondown-)\n* [`addListener('buttonHold', ...)`](#addlistenerbuttonhold-)\n* [`addListener('buttonReady', ...)`](#addlistenerbuttonready-)\n* [`addListener('buttonSingleClick', ...)`](#addlistenerbuttonsingleclick-)\n* [`addListener('buttonUnpaired', ...)`](#addlistenerbuttonunpaired-)\n* [`addListener('buttonUp', ...)`](#addlistenerbuttonup-)\n* [`addListener('scanStatusChanged', ...)`](#addlistenerscanstatuschanged-)\n* [`removeAllListeners()`](#removealllisteners)\n* [Interfaces](#interfaces)\n* [Type Aliases](#type-aliases)\n* [Enums](#enums)\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### checkPermissions()\n\n```typescript\ncheckPermissions() => Promise<PermissionStatus>\n```\n\nCheck the status of the permissions that are required to use Flic buttons.\n\nOn iOS, the Bluetooth permission is requested when `initialize(...)` is called.\n\nOnly available on Android and iOS.\n\n**Returns:** <code>Promise&lt;<a href=\"#permissionstatus\">PermissionStatus</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### connectButtonById(...)\n\n```typescript\nconnectButtonById(options: ConnectButtonByIdOptions) => Promise<void>\n```\n\nConnect a button.\n\nThe returned promise resolves immediately. The connection is established\nas soon as the button is available and does not time out. Listen to the\n`buttonConnected` and `buttonReady` events to know when the button is\nready to be used.\n\nOnly available on Android and iOS.\n\n| Param         | Type                                                                          |\n| ------------- | ----------------------------------------------------------------------------- |\n| **`options`** | <code><a href=\"#connectbuttonbyidoptions\">ConnectButtonByIdOptions</a></code> |\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### disconnectButtonById(...)\n\n```typescript\ndisconnectButtonById(options: DisconnectButtonByIdOptions) => Promise<void>\n```\n\nDisconnect a button or cancel a pending connection.\n\nOnly available on Android and iOS.\n\n| Param         | Type                                                                                |\n| ------------- | ----------------------------------------------------------------------------------- |\n| **`options`** | <code><a href=\"#disconnectbuttonbyidoptions\">DisconnectButtonByIdOptions</a></code> |\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### forgetButtonById(...)\n\n```typescript\nforgetButtonById(options: ForgetButtonByIdOptions) => Promise<void>\n```\n\nForget a button.\n\nThis removes the pairing with the button. To use the button again,\nit must be paired again using `startScan()`.\n\nOnly available on Android and iOS.\n\n| Param         | Type                                                                        |\n| ------------- | --------------------------------------------------------------------------- |\n| **`options`** | <code><a href=\"#forgetbuttonbyidoptions\">ForgetButtonByIdOptions</a></code> |\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### getButtons()\n\n```typescript\ngetButtons() => Promise<GetButtonsResult>\n```\n\nGet all buttons that are currently paired with the app.\n\nOnly available on Android and iOS.\n\n**Returns:** <code>Promise&lt;<a href=\"#getbuttonsresult\">GetButtonsResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### initialize(...)\n\n```typescript\ninitialize(options?: InitializeOptions | undefined) => Promise<void>\n```\n\nInitialize the plugin.\n\nThis method must be called before any other method.\nIt is recommended to call this method as soon as possible\nafter the app has launched to minimize the delay of any\npending button events.\n\nOn iOS, this method triggers the Bluetooth permission prompt\nif the permission has not yet been granted.\n\nOnly available on Android and iOS.\n\n| Param         | Type                                                            |\n| ------------- | --------------------------------------------------------------- |\n| **`options`** | <code><a href=\"#initializeoptions\">InitializeOptions</a></code> |\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### requestPermissions()\n\n```typescript\nrequestPermissions() => Promise<PermissionStatus>\n```\n\nRequest the permissions that are required to use Flic buttons.\n\nOn iOS, this method only returns the current permission status since\nthe Bluetooth permission is requested when `initialize(...)` is called.\n\nOnly available on Android and iOS.\n\n**Returns:** <code>Promise&lt;<a href=\"#permissionstatus\">PermissionStatus</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### startScan()\n\n```typescript\nstartScan() => Promise<StartScanResult>\n```\n\nStart scanning for new buttons to pair.\n\nTo pair a button, press and hold it for at least 6 seconds while scanning.\nThe returned promise resolves with the paired button once the pairing\nhas completed. Listen to the `scanStatusChanged` event to keep the user\ninformed about the scan progress.\n\nOnly one scan can be running at a time.\n\nOnly available on Android and iOS.\n\n**Returns:** <code>Promise&lt;<a href=\"#startscanresult\">StartScanResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### stopScan()\n\n```typescript\nstopScan() => Promise<void>\n```\n\nStop an ongoing scan.\n\nThis rejects the pending `startScan()` call.\n\nOnly available on Android and iOS.\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### addListener('buttonConnected', ...)\n\n```typescript\naddListener(eventName: 'buttonConnected', listenerFunc: (event: ButtonConnectedEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when a button establishes a Bluetooth connection.\n\nThe button is not ready to be used until the `buttonReady` event is emitted.\n\nOnly available on Android and iOS.\n\n| Param              | Type                                                                                      |\n| ------------------ | ----------------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'buttonConnected'</code>                                                            |\n| **`listenerFunc`** | <code>(event: <a href=\"#buttonconnectedevent\">ButtonConnectedEvent</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### addListener('buttonConnectionFailed', ...)\n\n```typescript\naddListener(eventName: 'buttonConnectionFailed', listenerFunc: (event: ButtonConnectionFailedEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when a connection attempt to a button fails.\n\nOnly available on Android and iOS.\n\n| Param              | Type                                                                                                    |\n| ------------------ | ------------------------------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'buttonConnectionFailed'</code>                                                                   |\n| **`listenerFunc`** | <code>(event: <a href=\"#buttonconnectionfailedevent\">ButtonConnectionFailedEvent</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### addListener('buttonDisconnected', ...)\n\n```typescript\naddListener(eventName: 'buttonDisconnected', listenerFunc: (event: ButtonDisconnectedEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when the Bluetooth connection with a button is lost.\n\nOnly available on Android and iOS.\n\n| Param              | Type                                                                                            |\n| ------------------ | ----------------------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'buttonDisconnected'</code>                                                               |\n| **`listenerFunc`** | <code>(event: <a href=\"#buttondisconnectedevent\">ButtonDisconnectedEvent</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### addListener('buttonDoubleClick', ...)\n\n```typescript\naddListener(eventName: 'buttonDoubleClick', listenerFunc: (event: ButtonEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when a button is double clicked.\n\nOnly available on Android and iOS.\n\n| Param              | Type                                                                    |\n| ------------------ | ----------------------------------------------------------------------- |\n| **`eventName`**    | <code>'buttonDoubleClick'</code>                                        |\n| **`listenerFunc`** | <code>(event: <a href=\"#buttonevent\">ButtonEvent</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### addListener('buttonDown', ...)\n\n```typescript\naddListener(eventName: 'buttonDown', listenerFunc: (event: ButtonEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when a button is pressed down.\n\nOnly available on Android and iOS.\n\n| Param              | Type                                                                    |\n| ------------------ | ----------------------------------------------------------------------- |\n| **`eventName`**    | <code>'buttonDown'</code>                                               |\n| **`listenerFunc`** | <code>(event: <a href=\"#buttonevent\">ButtonEvent</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### addListener('buttonHold', ...)\n\n```typescript\naddListener(eventName: 'buttonHold', listenerFunc: (event: ButtonEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when a button is held down.\n\nOnly available on Android and iOS.\n\n| Param              | Type                                                                    |\n| ------------------ | ----------------------------------------------------------------------- |\n| **`eventName`**    | <code>'buttonHold'</code>                                               |\n| **`listenerFunc`** | <code>(event: <a href=\"#buttonevent\">ButtonEvent</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### addListener('buttonReady', ...)\n\n```typescript\naddListener(eventName: 'buttonReady', listenerFunc: (event: ButtonReadyEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when a button has been cryptographically verified after a connection\nand is ready to be used.\n\nOnly available on Android and iOS.\n\n| Param              | Type                                                                              |\n| ------------------ | --------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'buttonReady'</code>                                                        |\n| **`listenerFunc`** | <code>(event: <a href=\"#buttonreadyevent\">ButtonReadyEvent</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### addListener('buttonSingleClick', ...)\n\n```typescript\naddListener(eventName: 'buttonSingleClick', listenerFunc: (event: ButtonEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when a button is clicked once.\n\nOnly available on Android and iOS.\n\n| Param              | Type                                                                    |\n| ------------------ | ----------------------------------------------------------------------- |\n| **`eventName`**    | <code>'buttonSingleClick'</code>                                        |\n| **`listenerFunc`** | <code>(event: <a href=\"#buttonevent\">ButtonEvent</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### addListener('buttonUnpaired', ...)\n\n```typescript\naddListener(eventName: 'buttonUnpaired', listenerFunc: (event: ButtonUnpairedEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when the pairing with a button is no longer valid, for example\nbecause the button has been factory reset. In this case, the button must\nbe forgotten using `forgetButtonById(...)` and then paired again.\n\nOnly available on Android and iOS.\n\n| Param              | Type                                                                                    |\n| ------------------ | --------------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'buttonUnpaired'</code>                                                           |\n| **`listenerFunc`** | <code>(event: <a href=\"#buttonunpairedevent\">ButtonUnpairedEvent</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### addListener('buttonUp', ...)\n\n```typescript\naddListener(eventName: 'buttonUp', listenerFunc: (event: ButtonEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when a button is released.\n\nOnly available on Android and iOS.\n\n| Param              | Type                                                                    |\n| ------------------ | ----------------------------------------------------------------------- |\n| **`eventName`**    | <code>'buttonUp'</code>                                                 |\n| **`listenerFunc`** | <code>(event: <a href=\"#buttonevent\">ButtonEvent</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### addListener('scanStatusChanged', ...)\n\n```typescript\naddListener(eventName: 'scanStatusChanged', listenerFunc: (event: ScanStatusChangedEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when the status of an ongoing scan changes.\n\nOnly available on Android and iOS.\n\n| Param              | Type                                                                                          |\n| ------------------ | --------------------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'scanStatusChanged'</code>                                                              |\n| **`listenerFunc`** | <code>(event: <a href=\"#scanstatuschangedevent\">ScanStatusChangedEvent</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#### PermissionStatus\n\n| Prop                   | Type                                                        | Description                                                                                                                        | Since |\n| ---------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ----- |\n| **`bluetooth`**        | <code><a href=\"#permissionstate\">PermissionState</a></code> | The permission state of the Bluetooth permission. Only available on iOS.                                                           | 0.1.0 |\n| **`bluetoothConnect`** | <code><a href=\"#permissionstate\">PermissionState</a></code> | The permission state of the `BLUETOOTH_CONNECT` permission. Only required on Android 12 and later. Only available on Android.      | 0.1.0 |\n| **`bluetoothScan`**    | <code><a href=\"#permissionstate\">PermissionState</a></code> | The permission state of the `BLUETOOTH_SCAN` permission. Only required on Android 12 and later. Only available on Android.         | 0.1.0 |\n| **`location`**         | <code><a href=\"#permissionstate\">PermissionState</a></code> | The permission state of the `ACCESS_FINE_LOCATION` permission. Only required on Android 11 and earlier. Only available on Android. | 0.1.0 |\n\n\n#### ConnectButtonByIdOptions\n\n| Prop     | Type                | Description                   | Since |\n| -------- | ------------------- | ----------------------------- | ----- |\n| **`id`** | <code>string</code> | The identifier of the button. | 0.1.0 |\n\n\n#### DisconnectButtonByIdOptions\n\n| Prop     | Type                | Description                   | Since |\n| -------- | ------------------- | ----------------------------- | ----- |\n| **`id`** | <code>string</code> | The identifier of the button. | 0.1.0 |\n\n\n#### ForgetButtonByIdOptions\n\n| Prop     | Type                | Description                   | Since |\n| -------- | ------------------- | ----------------------------- | ----- |\n| **`id`** | <code>string</code> | The identifier of the button. | 0.1.0 |\n\n\n#### GetButtonsResult\n\n| Prop          | Type                  | Description                                         | Since |\n| ------------- | --------------------- | --------------------------------------------------- | ----- |\n| **`buttons`** | <code>Button[]</code> | The buttons that are currently paired with the app. | 0.1.0 |\n\n\n#### Button\n\n| Prop                  | Type                                                                    | Description                                                                                                                                                                                                                                | Since |\n| --------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |\n| **`batteryVoltage`**  | <code>number</code>                                                     | The last known battery voltage of the button in volts. If no battery sample has been taken yet, this property is not available. It is recommended to show a \"change the battery soon\" hint in your app once the voltage goes below `2.65`. | 0.1.0 |\n| **`connectionState`** | <code><a href=\"#buttonconnectionstate\">ButtonConnectionState</a></code> | The connection state of the button.                                                                                                                                                                                                        | 0.1.0 |\n| **`firmwareVersion`** | <code>number</code>                                                     | The revision of the firmware currently running on the button.                                                                                                                                                                              | 0.1.0 |\n| **`id`**              | <code>string</code>                                                     | The identifier of the button on this device. On Android, this is the Bluetooth address of the button. On iOS, this is an identifier that is guaranteed to be the same for each button paired to a particular device.                       | 0.1.0 |\n| **`isReady`**         | <code>boolean</code>                                                    | Whether or not the button has been cryptographically verified after a connection and is ready to be used.                                                                                                                                  | 0.1.0 |\n| **`isUnpaired`**      | <code>boolean</code>                                                    | Whether or not the pairing with the button is no longer valid, for example because the button has been factory reset. In this case, the button must be forgotten using `forgetButtonById(...)` and then paired again.                      | 0.1.0 |\n| **`name`**            | <code>string</code>                                                     | The human readable name of the button that the user may change in the official Flic app.                                                                                                                                                   | 0.1.0 |\n| **`pressCount`**      | <code>number</code>                                                     | The number of times the button has been clicked since it last booted.                                                                                                                                                                      | 0.1.0 |\n| **`serialNumber`**    | <code>string</code>                                                     | The serial number of the button that is printed on the backside of the button inside the battery hatch.                                                                                                                                    | 0.1.0 |\n| **`uuid`**            | <code>string</code>                                                     | The unique identifier of the button that is the same across devices and apps.                                                                                                                                                              | 0.1.0 |\n\n\n#### InitializeOptions\n\n| Prop                | Type                 | Description                                                                                                                                                                                                              | Default            | Since |\n| ------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------ | ----- |\n| **`iosBackground`** | <code>boolean</code> | Whether or not you intend to use the buttons while the app is in the background. If set to `true`, the `Uses Bluetooth LE accessories` background mode must be enabled in the app's capabilities. Only available on iOS. | <code>false</code> | 0.1.0 |\n\n\n#### StartScanResult\n\n| Prop         | Type                                      | Description                 | Since |\n| ------------ | ----------------------------------------- | --------------------------- | ----- |\n| **`button`** | <code><a href=\"#button\">Button</a></code> | The button that was paired. | 0.1.0 |\n\n\n#### PluginListenerHandle\n\n| Prop         | Type                                      |\n| ------------ | ----------------------------------------- |\n| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |\n\n\n#### ButtonConnectedEvent\n\n| Prop           | Type                | Description                   | Since |\n| -------------- | ------------------- | ----------------------------- | ----- |\n| **`buttonId`** | <code>string</code> | The identifier of the button. | 0.1.0 |\n\n\n#### ButtonConnectionFailedEvent\n\n| Prop           | Type                | Description                                                   | Since |\n| -------------- | ------------------- | ------------------------------------------------------------- | ----- |\n| **`buttonId`** | <code>string</code> | The identifier of the button.                                 | 0.1.0 |\n| **`message`**  | <code>string</code> | The message that describes why the connection attempt failed. | 0.1.0 |\n\n\n#### ButtonDisconnectedEvent\n\n| Prop           | Type                | Description                   | Since |\n| -------------- | ------------------- | ----------------------------- | ----- |\n| **`buttonId`** | <code>string</code> | The identifier of the button. | 0.1.0 |\n\n\n#### ButtonEvent\n\n| Prop            | Type                 | Description                                                                              | Since |\n| --------------- | -------------------- | ---------------------------------------------------------------------------------------- | ----- |\n| **`buttonId`**  | <code>string</code>  | The identifier of the button.                                                            | 0.1.0 |\n| **`timestamp`** | <code>number</code>  | The timestamp of the event in milliseconds since the Unix epoch.                         | 0.1.0 |\n| **`wasQueued`** | <code>boolean</code> | Whether or not the event was queued because it occurred before the button was connected. | 0.1.0 |\n\n\n#### ButtonReadyEvent\n\n| Prop           | Type                | Description                   | Since |\n| -------------- | ------------------- | ----------------------------- | ----- |\n| **`buttonId`** | <code>string</code> | The identifier of the button. | 0.1.0 |\n\n\n#### ButtonUnpairedEvent\n\n| Prop           | Type                | Description                   | Since |\n| -------------- | ------------------- | ----------------------------- | ----- |\n| **`buttonId`** | <code>string</code> | The identifier of the button. | 0.1.0 |\n\n\n#### ScanStatusChangedEvent\n\n| Prop         | Type                                              | Description             | Since |\n| ------------ | ------------------------------------------------- | ----------------------- | ----- |\n| **`status`** | <code><a href=\"#scanstatus\">ScanStatus</a></code> | The status of the scan. | 0.1.0 |\n\n\n### Type Aliases\n\n\n#### PermissionState\n\n<code>'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'</code>\n\n\n### Enums\n\n\n#### ButtonConnectionState\n\n| Members             | Value                        | Description                                                                                                          | Since |\n| ------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------- | ----- |\n| **`Connected`**     | <code>'CONNECTED'</code>     | The button is connected.                                                                                             | 0.1.0 |\n| **`Connecting`**    | <code>'CONNECTING'</code>    | The button is disconnected but a pending connection is set. The button will connect as soon as it becomes available. | 0.1.0 |\n| **`Disconnected`**  | <code>'DISCONNECTED'</code>  | The button is disconnected and no pending connection is set.                                                         | 0.1.0 |\n| **`Disconnecting`** | <code>'DISCONNECTING'</code> | The button is connected but is attempting to disconnect. Only available on iOS.                                      | 0.1.0 |\n\n\n#### ScanStatus\n\n| Members                      | Value                                     | Description                                                                            | Since |\n| ---------------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------- | ----- |\n| **`AskToAcceptPairRequest`** | <code>'ASK_TO_ACCEPT_PAIR_REQUEST'</code> | The user must accept the system pairing dialog to continue. Only available on Android. | 0.1.0 |\n| **`Connected`**              | <code>'CONNECTED'</code>                  | A button was found and a connection is being established.                              | 0.1.0 |\n| **`Discovered`**             | <code>'DISCOVERED'</code>                 | A button was discovered.                                                               | 0.1.0 |\n| **`Verified`**               | <code>'VERIFIED'</code>                   | The button has been cryptographically verified. Only available on iOS.                 | 0.1.0 |\n\n</docgen-api>\n\n## FAQ\n\n### Which Flic buttons are supported?\n\nThe plugin supports Flic 2 buttons. For the Flic Duo, only the events of the big button are currently delivered.\n\n### Does the plugin receive button events while the app is in the background?\n\nOn Android, events are delivered as long as the app process is alive. Consider using the [Android Foreground Service](https://capawesome.io/docs/sdks/capacitor/android-foreground-service/) plugin to keep the app process alive. On iOS, enable the `Uses Bluetooth LE accessories` background mode and call `initialize(...)` with the `iosBackground` option set to `true` (see [Installation](#installation)).\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- [Android Foreground Service](https://capawesome.io/docs/sdks/capacitor/android-foreground-service/): Keep the app process alive to receive button events in the background on Android.\n- [Bluetooth Low Energy](https://capawesome.io/docs/sdks/capacitor/bluetooth-low-energy/): Communicate with other Bluetooth Low Energy devices.\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/flic/CHANGELOG.md).\n\n## License\n\nSee [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/flic/LICENSE).\n\nThe bundled [flic2lib](https://github.com/50ButtonsEach/flic2lib-ios) binary is distributed under its own license from Shortcut Labs AB (see [flic2lib-LICENCE.txt](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/flic/ios/flic2lib-LICENCE.txt)).\n\n[^1]: This project is not affiliated with, endorsed by, sponsored by, or approved by Shortcut Labs AB or any of its affiliates or subsidiaries. \"Flic\" is a trademark of Shortcut Labs AB.\n","readmeFilename":"README.md"}