0.1.5 • Published 2 years ago

rn-android-ble-watcher v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React Native Android BLE Watcher

Watches for Bluetooth Connections and runs background task

Installation

npm install rn-android-ble-watcher

Usage

BackgroundTask.js

module.exports = async (args) => {
    console.log('Background task called', args);
};
import {AppRegistry} from 'react-native';

import { configure, startMonitoring, stopMonitoring} from "rn-android-ble-watcher";

import BackgroundTask from './BackgroundTask.js';

AppRegistry.registerHeadlessTask('MyBackgroundTask', () => BackgroundTask);

// ...
configure({
    notification: {
        channelId:'MyExampleApp',
        channelName: 'My Example App',
    },
});

// Starts monitoring for device with address FF:FF:FF:FF:FF:FF and runs MyBackgroundTask
startMonitoring('FF:FF:FF:FF:FF:FF', 'MyBackgroundTask');

// stopMonitoring();
0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago