Development applications used for programing/testing react-native-bluetooth-classic
Originally the development and example apps were stored inside the library itself react-native-blueooth-classic/BluetoothClassicExample
which caused two major issues:
- There were issues writing tests (dependencies required for testing broke the Example app)
- With more apps being required (multiple React Native versions, functionality showcase, etc) the library would be polluted
Feel free to add your own sample application, either:
- Within this project, specifically if help testing/debugging is required
- Updating this
README.md
with a link to your showcase application
Android Permissions!
When working with Android you'll need to request permissions manually:
import { PermissionsAndroid } from 'react-native';
/**
* See https://reactnative.dev/docs/permissionsandroid for more information
* on why this is required (dangerous permissions).
*/
const requestAccessFineLocationPermission = async () => {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
{
title: 'Access fine location required for discovery',
message:
'In order to perform discovery, you must enable/allow ' +
'fine location access.',
buttonNeutral: 'Ask Me Later',
buttonNegative: 'Cancel',
buttonPositive: 'OK',
}
);
return granted === PermissionsAndroid.RESULTS.GRANTED;
};
The primary application used during development.
- Supports the lowest versions of React Native (0.60.0), Android (26) and IOS (9)
- Provides almost all functionality from the library
- Configured to use the locally installed
../../react-native-bluetooth-classic/
project.