npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

capacitor-ibeacon

v0.1.0

Published

IBeacon Transmit and Scan

Downloads

14

Readme

capacitor-ibeacon

CircleCI

A Capacitor plugin for transmitting and receiving iBeacon regions and ranging over Bluetooth.

Supports:

  • [x] iOS
  • [ ] Android
  • [ ] Web

The web bluetooth standard seems to be pretty dead in the water, so it is unlikely web will ever be supported.

Usage

import { Plugins } from '@capacitor/core';
import { IBeaconRegion, IBeaconAdvertisement } from 'capacitor-ibeacon';

const { IBeacon } = Plugins;

await IBeacon.requestAlwaysAuthorization();
IBeacon.addListener('enteredRegion', (response) => {
  const region = response.region;
  console.log(`Entered region: ${region.identifier} (${region.uuid})`);
});
IBeacon.addListener('leftRegion', (response) => {
  const region = response.region;
  console.log(`Left region: ${region.identifier} (${region.uuid})`);
});
IBeacon.startMonitoringForRegion({
  uuid: 'DEADBEEF-0000-0000-0000-000000000000',
  identifier: 'Dead Beef',
});

Version History

Changes made in the develop branch are checked against unit tests upon commit. The latest CHANGELOG.md is then auto-generated from the commit history and merged to master.

Installation

npm i capacitor-ibeacon
npx cap sync

iOS Setup

You will need to add one or more options to your Info.plist to have permissions to use Bluetooth and location services.

NSLocationAlwaysAndWhenInUseUsageDescription

This is for being able to get location events while in the foreground or background. You will need to call IBeacon.requestAlwaysAuthorization() at runtime before ranging.

Note that even if you ask for background use, the user is still able to disable support or allow only while in use in their phone settings.

NSLocationAlwaysAndWhenInUseUsageDescription is for iOS 13 and above. If you wish to support iOS 12 or lower, include it and NSBluetoothPeripheralUsageDescription.

<key>NSBluetoothPeripheralUsageDescription</key>
<string>This app would like to scan for iBeacons while in use and while in the background.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app would like to scan for iBeacons while in use and while in the background.</string>

NSLocationWhenInUseUsageDescription

This is for being able to get location events only while in the foreground. You will need to call IBeacon.requestWhenInUseAuthorization() at runtime before ranging.

<key>NSLocationWhenInUseUsageDescription</key>
<string>This app would like to scan for iBeacons while in use.</string>

NSBluetoothAlwaysUsageDescription

This is for being able to transmit or communicate with Bluetooth devices.

If you wish to support iOS 12 or lower, include it and NSBluetoothPeripheralUsageDescription.

<key>NSBluetoothAlwaysUsageDescription</key>
<string>This app would like to transmit or communicate with Bluetooth devices.</string>

NSBluetoothAlwaysUsageDescription is for iOS 13 and above. If you wish to support iOS 12 or lower, include it and NSBluetoothPeripheralUsageDescription.

Android Setup

TODO