New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@capacitor-community/bluetooth-le

Package Overview
Dependencies
Maintainers
34
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor-community/bluetooth-le - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

9

CHANGELOG.md

@@ -5,2 +5,11 @@ # Changelog

## [1.5.0](https://github.com/capacitor-community/bluetooth-le/compare/v1.4.0...v1.5.0) (2021-10-02)
### Features
* **android:** add enable and disable methods ([53f1b3d](https://github.com/capacitor-community/bluetooth-le/commit/53f1b3db51a4cc00547307b46e6dbde50c895d28))
* **android:** add new methods isLocationEnabled, openLocationSettings and openBluetoothSettings ([4c1cc60](https://github.com/capacitor-community/bluetooth-le/commit/4c1cc60b76736c0693d7c7bfab1e093710289c68))
* **ios:** add openAppSettings method ([f57fac7](https://github.com/capacitor-community/bluetooth-le/commit/f57fac7fa7689b472b27d7c16dbfc594d9ef3a2c))
## [1.4.0](https://github.com/capacitor-community/bluetooth-le/compare/v1.3.1...v1.4.0) (2021-09-24)

@@ -7,0 +16,0 @@

68

dist/docs.json

@@ -24,3 +24,3 @@ {

"tags": [],
"docs": "Reports whether BLE is enabled on this device.\nAlways returns `true` on **web**.",
"docs": "Reports whether Bluetooth is enabled on this device.\nAlways returns `true` on **web**.",
"complexTypes": [],

@@ -30,2 +30,22 @@ "slug": "isenabled"

{
"name": "enable",
"signature": "() => Promise<void>",
"parameters": [],
"returns": "Promise<void>",
"tags": [],
"docs": "Enable Bluetooth.\nOnly available on **Android**.",
"complexTypes": [],
"slug": "enable"
},
{
"name": "disable",
"signature": "() => Promise<void>",
"parameters": [],
"returns": "Promise<void>",
"tags": [],
"docs": "Disable Bluetooth.\nOnly available on **Android**.",
"complexTypes": [],
"slug": "disable"
},
{
"name": "startEnabledNotifications",

@@ -36,3 +56,3 @@ "signature": "(callback: (value: boolean) => void) => Promise<void>",

"name": "callback",
"docs": "Callback function to use when the BLE state changes.",
"docs": "Callback function to use when the Bluetooth state changes.",
"type": "(value: boolean) => void"

@@ -45,6 +65,6 @@ }

"name": "param",
"text": "callback Callback function to use when the BLE state changes."
"text": "callback Callback function to use when the Bluetooth state changes."
}
],
"docs": "Register a callback function that will be invoked when BLE is enabled (true) or disabled (false) on this device.\nNot available on **web** (the callback will never be invoked).",
"docs": "Register a callback function that will be invoked when Bluetooth is enabled (true) or disabled (false) on this device.\nNot available on **web** (the callback will never be invoked).",
"complexTypes": [],

@@ -64,2 +84,42 @@ "slug": "startenablednotifications"

{
"name": "isLocationEnabled",
"signature": "() => Promise<boolean>",
"parameters": [],
"returns": "Promise<boolean>",
"tags": [],
"docs": "Reports whether Location Services are enabled on this device.\nOnly available on **Android**.",
"complexTypes": [],
"slug": "islocationenabled"
},
{
"name": "openLocationSettings",
"signature": "() => Promise<void>",
"parameters": [],
"returns": "Promise<void>",
"tags": [],
"docs": "Open Location settings.\nOnly available on **Android**.",
"complexTypes": [],
"slug": "openlocationsettings"
},
{
"name": "openBluetoothSettings",
"signature": "() => Promise<void>",
"parameters": [],
"returns": "Promise<void>",
"tags": [],
"docs": "Open Bluetooth settings.\nOnly available on **Android**.",
"complexTypes": [],
"slug": "openbluetoothsettings"
},
{
"name": "openAppSettings",
"signature": "() => Promise<void>",
"parameters": [],
"returns": "Promise<void>",
"tags": [],
"docs": "Open App settings.\nOnly available on **iOS**.\nOn **iOS** when a user declines the request to use Bluetooth on the first call of `initialize`, it is not possible\nto request for Bluetooth again from within the app. In this case Bluetooth has to be enabled in the app settings\nfor the app to use it.",
"complexTypes": [],
"slug": "openappsettings"
},
{
"name": "setDisplayStrings",

@@ -66,0 +126,0 @@ "signature": "(displayStrings: DisplayStrings) => Promise<void>",

@@ -11,3 +11,3 @@ import type { DisplayStrings } from './config';

/**
* Reports whether BLE is enabled on this device.
* Reports whether Bluetooth is enabled on this device.
* Always returns `true` on **web**.

@@ -17,5 +17,15 @@ */

/**
* Register a callback function that will be invoked when BLE is enabled (true) or disabled (false) on this device.
* Enable Bluetooth.
* Only available on **Android**.
*/
enable(): Promise<void>;
/**
* Disable Bluetooth.
* Only available on **Android**.
*/
disable(): Promise<void>;
/**
* Register a callback function that will be invoked when Bluetooth is enabled (true) or disabled (false) on this device.
* Not available on **web** (the callback will never be invoked).
* @param callback Callback function to use when the BLE state changes.
* @param callback Callback function to use when the Bluetooth state changes.
*/

@@ -28,2 +38,25 @@ startEnabledNotifications(callback: (value: boolean) => void): Promise<void>;

/**
* Reports whether Location Services are enabled on this device.
* Only available on **Android**.
*/
isLocationEnabled(): Promise<boolean>;
/**
* Open Location settings.
* Only available on **Android**.
*/
openLocationSettings(): Promise<void>;
/**
* Open Bluetooth settings.
* Only available on **Android**.
*/
openBluetoothSettings(): Promise<void>;
/**
* Open App settings.
* Only available on **iOS**.
* On **iOS** when a user declines the request to use Bluetooth on the first call of `initialize`, it is not possible
* to request for Bluetooth again from within the app. In this case Bluetooth has to be enabled in the app settings
* for the app to use it.
*/
openAppSettings(): Promise<void>;
/**
* Set the strings that are displayed in the `requestDevice` dialog.

@@ -154,4 +187,10 @@ * @param displayStrings

isEnabled(): Promise<boolean>;
enable(): Promise<void>;
disable(): Promise<void>;
startEnabledNotifications(callback: (value: boolean) => void): Promise<void>;
stopEnabledNotifications(): Promise<void>;
isLocationEnabled(): Promise<boolean>;
openLocationSettings(): Promise<void>;
openBluetoothSettings(): Promise<void>;
openAppSettings(): Promise<void>;
setDisplayStrings(displayStrings: DisplayStrings): Promise<void>;

@@ -158,0 +197,0 @@ requestDevice(options?: RequestBleDeviceOptions): Promise<BleDevice>;

@@ -38,2 +38,12 @@ import { Capacitor } from '@capacitor/core';

}
async enable() {
await this.queue(async () => {
await BluetoothLe.enable();
});
}
async disable() {
await this.queue(async () => {
await BluetoothLe.disable();
});
}
async startEnabledNotifications(callback) {

@@ -60,2 +70,24 @@ await this.queue(async () => {

}
async isLocationEnabled() {
const enabled = await this.queue(async () => {
const result = await BluetoothLe.isLocationEnabled();
return result.value;
});
return enabled;
}
async openLocationSettings() {
await this.queue(async () => {
await BluetoothLe.openLocationSettings();
});
}
async openBluetoothSettings() {
await this.queue(async () => {
await BluetoothLe.openBluetoothSettings();
});
}
async openAppSettings() {
await this.queue(async () => {
await BluetoothLe.openAppSettings();
});
}
async setDisplayStrings(displayStrings) {

@@ -62,0 +94,0 @@ await this.queue(async () => {

@@ -192,4 +192,10 @@ import type { PluginListenerHandle } from '@capacitor/core';

isEnabled(): Promise<BooleanResult>;
enable(): Promise<void>;
disable(): Promise<void>;
startEnabledNotifications(): Promise<void>;
stopEnabledNotifications(): Promise<void>;
isLocationEnabled(): Promise<BooleanResult>;
openLocationSettings(): Promise<void>;
openBluetoothSettings(): Promise<void>;
openAppSettings(): Promise<void>;
setDisplayStrings(displayStrings: DisplayStrings): Promise<void>;

@@ -196,0 +202,0 @@ requestDevice(options?: RequestBleDeviceOptions): Promise<BleDevice>;

@@ -11,4 +11,10 @@ import { WebPlugin } from '@capacitor/core';

isEnabled(): Promise<BooleanResult>;
enable(): Promise<void>;
disable(): Promise<void>;
startEnabledNotifications(): Promise<void>;
stopEnabledNotifications(): Promise<void>;
isLocationEnabled(): Promise<BooleanResult>;
openLocationSettings(): Promise<void>;
openBluetoothSettings(): Promise<void>;
openAppSettings(): Promise<void>;
setDisplayStrings(): Promise<void>;

@@ -15,0 +21,0 @@ requestDevice(options?: RequestBleDeviceOptions): Promise<BleDevice>;

@@ -25,2 +25,8 @@ import { WebPlugin } from '@capacitor/core';

}
async enable() {
throw this.unavailable('enable is not available on web.');
}
async disable() {
throw this.unavailable('disable is not available on web.');
}
async startEnabledNotifications() {

@@ -32,2 +38,14 @@ // not available on web

}
async isLocationEnabled() {
throw this.unavailable('isLocationEnabled is not available on web.');
}
async openLocationSettings() {
throw this.unavailable('openLocationSettings is not available on web.');
}
async openBluetoothSettings() {
throw this.unavailable('openBluetoothSettings is not available on web.');
}
async openAppSettings() {
throw this.unavailable('openAppSettings is not available on web.');
}
async setDisplayStrings() {

@@ -34,0 +52,0 @@ // not available on web

@@ -151,2 +151,12 @@ 'use strict';

}
async enable() {
await this.queue(async () => {
await BluetoothLe$1.enable();
});
}
async disable() {
await this.queue(async () => {
await BluetoothLe$1.disable();
});
}
async startEnabledNotifications(callback) {

@@ -173,2 +183,24 @@ await this.queue(async () => {

}
async isLocationEnabled() {
const enabled = await this.queue(async () => {
const result = await BluetoothLe$1.isLocationEnabled();
return result.value;
});
return enabled;
}
async openLocationSettings() {
await this.queue(async () => {
await BluetoothLe$1.openLocationSettings();
});
}
async openBluetoothSettings() {
await this.queue(async () => {
await BluetoothLe$1.openBluetoothSettings();
});
}
async openAppSettings() {
await this.queue(async () => {
await BluetoothLe$1.openAppSettings();
});
}
async setDisplayStrings(displayStrings) {

@@ -403,2 +435,8 @@ await this.queue(async () => {

}
async enable() {
throw this.unavailable('enable is not available on web.');
}
async disable() {
throw this.unavailable('disable is not available on web.');
}
async startEnabledNotifications() {

@@ -410,2 +448,14 @@ // not available on web

}
async isLocationEnabled() {
throw this.unavailable('isLocationEnabled is not available on web.');
}
async openLocationSettings() {
throw this.unavailable('openLocationSettings is not available on web.');
}
async openBluetoothSettings() {
throw this.unavailable('openBluetoothSettings is not available on web.');
}
async openAppSettings() {
throw this.unavailable('openAppSettings is not available on web.');
}
async setDisplayStrings() {

@@ -412,0 +462,0 @@ // not available on web

@@ -147,2 +147,12 @@ var capacitorCommunityBluetoothLe = (function (exports, core, throat) {

}
async enable() {
await this.queue(async () => {
await BluetoothLe$1.enable();
});
}
async disable() {
await this.queue(async () => {
await BluetoothLe$1.disable();
});
}
async startEnabledNotifications(callback) {

@@ -169,2 +179,24 @@ await this.queue(async () => {

}
async isLocationEnabled() {
const enabled = await this.queue(async () => {
const result = await BluetoothLe$1.isLocationEnabled();
return result.value;
});
return enabled;
}
async openLocationSettings() {
await this.queue(async () => {
await BluetoothLe$1.openLocationSettings();
});
}
async openBluetoothSettings() {
await this.queue(async () => {
await BluetoothLe$1.openBluetoothSettings();
});
}
async openAppSettings() {
await this.queue(async () => {
await BluetoothLe$1.openAppSettings();
});
}
async setDisplayStrings(displayStrings) {

@@ -399,2 +431,8 @@ await this.queue(async () => {

}
async enable() {
throw this.unavailable('enable is not available on web.');
}
async disable() {
throw this.unavailable('disable is not available on web.');
}
async startEnabledNotifications() {

@@ -406,2 +444,14 @@ // not available on web

}
async isLocationEnabled() {
throw this.unavailable('isLocationEnabled is not available on web.');
}
async openLocationSettings() {
throw this.unavailable('openLocationSettings is not available on web.');
}
async openBluetoothSettings() {
throw this.unavailable('openBluetoothSettings is not available on web.');
}
async openAppSettings() {
throw this.unavailable('openAppSettings is not available on web.');
}
async setDisplayStrings() {

@@ -408,0 +458,0 @@ // not available on web

14

package.json
{
"name": "@capacitor-community/bluetooth-le",
"version": "1.4.0",
"version": "1.5.0",
"description": "Capacitor plugin for Bluetooth Low Energy ",

@@ -40,7 +40,7 @@ "main": "dist/plugin.cjs.js",

"devDependencies": {
"@capacitor/android": "^3.2.3",
"@capacitor/cli": "^3.2.3",
"@capacitor/core": "^3.2.3",
"@capacitor/android": "^3.2.4",
"@capacitor/cli": "^3.2.4",
"@capacitor/core": "^3.2.4",
"@capacitor/docgen": "^0.0.17",
"@capacitor/ios": "^3.2.3",
"@capacitor/ios": "^3.2.4",
"@ionic/eslint-config": "^0.3.0",

@@ -51,7 +51,7 @@ "@ionic/prettier-config": "^2.0.0",

"eslint": "^7.32.0",
"jest": "^27.2.1",
"jest": "^27.2.4",
"prettier": "^2.4.1",
"prettier-plugin-java": "^1.4.0",
"rimraf": "^3.0.2",
"rollup": "^2.57.0",
"rollup": "^2.58.0",
"standard-version": "^9.3.1",

@@ -58,0 +58,0 @@ "swiftlint": "^1.0.1",

@@ -47,4 +47,10 @@ <p align="center"><br><img src="https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png" width="128" height="128" /></p>

- [`isEnabled()`](#isenabled)
- [`enable()`](#enable)
- [`disable()`](#disable)
- [`startEnabledNotifications(...)`](#startenablednotifications)
- [`stopEnabledNotifications()`](#stopenablednotifications)
- [`isLocationEnabled()`](#islocationenabled)
- [`openLocationSettings()`](#openlocationsettings)
- [`openBluetoothSettings()`](#openbluetoothsettings)
- [`openAppSettings()`](#openappsettings)
- [`setDisplayStrings(...)`](#setdisplaystrings)

@@ -282,3 +288,3 @@ - [`requestDevice(...)`](#requestdevice)

Reports whether BLE is enabled on this device.
Reports whether Bluetooth is enabled on this device.
Always returns `true` on **web**.

@@ -290,2 +296,24 @@

### enable()
```typescript
enable() => Promise<void>
```
Enable Bluetooth.
Only available on **Android**.
---
### disable()
```typescript
disable() => Promise<void>
```
Disable Bluetooth.
Only available on **Android**.
---
### startEnabledNotifications(...)

@@ -297,8 +325,8 @@

Register a callback function that will be invoked when BLE is enabled (true) or disabled (false) on this device.
Register a callback function that will be invoked when Bluetooth is enabled (true) or disabled (false) on this device.
Not available on **web** (the callback will never be invoked).
| Param | Type | Description |
| -------------- | ---------------------------------------- | ---------------------------------------------------- |
| **`callback`** | <code>(value: boolean) =&gt; void</code> | Callback function to use when the BLE state changes. |
| Param | Type | Description |
| -------------- | ---------------------------------------- | ---------------------------------------------------------- |
| **`callback`** | <code>(value: boolean) =&gt; void</code> | Callback function to use when the Bluetooth state changes. |

@@ -317,2 +345,51 @@ ---

### isLocationEnabled()
```typescript
isLocationEnabled() => Promise<boolean>
```
Reports whether Location Services are enabled on this device.
Only available on **Android**.
**Returns:** <code>Promise&lt;boolean&gt;</code>
---
### openLocationSettings()
```typescript
openLocationSettings() => Promise<void>
```
Open Location settings.
Only available on **Android**.
---
### openBluetoothSettings()
```typescript
openBluetoothSettings() => Promise<void>
```
Open Bluetooth settings.
Only available on **Android**.
---
### openAppSettings()
```typescript
openAppSettings() => Promise<void>
```
Open App settings.
Only available on **iOS**.
On **iOS** when a user declines the request to use Bluetooth on the first call of `initialize`, it is not possible
to request for Bluetooth again from within the app. In this case Bluetooth has to be enabled in the app settings
for the app to use it.
---
### setDisplayStrings(...)

@@ -319,0 +396,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc