Important
This package was renamed please use the new package name! @evva/abrevva-react-native
The EVVA React-Native Module is a collection of tools to work with electronical EVVA access components. It allows for scanning and connecting via BLE.
- BLE Scanner for EVVA components in range
- Localize EVVA components encountered by a scan
- Disengage EVVA components encountered by a scan
- Read / Write data via BLE
- react-native < 0.74.3
- Java 17+ (Android)
- Android SDK (Android)
- Android 10+ (API level 29) (Android)
- Xcode 15.4 (iOS)
- iOS 15.0+ (iOS)
yarn add @evva/abrevva-react-native
Execute bundle exec pod install
inside of your projects ios/ folder.
Perform a gradle sync.
To start off first import AbrevvaBle
from this module
import { AbrevvaBle } from '@evva/abrevva-react-native';
async function scanForBleDevices(androidNeverForLocation: Boolean = true, timeout: Number) {
await AbrevvaBle.initialize(androidNeverForLocation);
AbrevvaBle.requestLEScan(
(data: ScanResult) => {
console.log(`Found device: ${data.name}`);
},
(address: string) => {
console.log(`Connected to device: ${address}`);
},
(address: string) => {
console.log(`Disconnected to device: ${address}`);
},
10_000
);
}
With the signalize method you can localize EVVA components. On a successful signalization the component will emit a melody indicating its location.
const success = await AbrevvaBle.signalize('deviceId');
For the component disengage you have to provide access credentials to the EVVA component. Those are generally acquired in the form of access media metadata from the Xesar software.
const status = await AbrevvaBle.disengage(
'deviceId',
'mobileId',
'mobileDeviceKey',
'mobileGroupId',
'mobileAccessData',
false,
);