https://github.com/swaroop325/react-native-armfit-sdk
React Native Armfit SDK
https://github.com/swaroop325/react-native-armfit-sdk
android ble bluetooth ios react-native
Last synced: 12 months ago
JSON representation
React Native Armfit SDK
- Host: GitHub
- URL: https://github.com/swaroop325/react-native-armfit-sdk
- Owner: swaroop325
- License: mit
- Created: 2021-12-28T15:30:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-25T11:34:47.000Z (over 4 years ago)
- Last Synced: 2025-04-07T08:01:44.475Z (over 1 year ago)
- Topics: android, ble, bluetooth, ios, react-native
- Language: Java
- Homepage: https://www.npmjs.com/package/react-native-armfit-sdk
- Size: 1.69 MB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-armfit-sdk
Connect and retrieve data from BLE devices
(Currently support only Android)
## Android Dependencies
Need to add the following permissions to AndroidManifest.xml file
```xml
```
If you need communication while the app is not in the foreground you need the "ACCESS_BACKGROUND_LOCATION" permission.
##### iOS - Update Info.plist
## Installation
```sh
npm install react-native-armfit-sdk
```
## Usage
```js
import ArmfitSdkManager from 'react-native-armfit-sdk';
var sdkManager = NativeModules.ArmfitSdk;
const sdkManagerEmitter = new NativeEventEmitter(sdkManager);
// ...
//Call this this durign the app init to invoke the sdk
ArmfitSdkManager.startSdk()
//To start the scan for 5 seconds
ArmfitSdkManager.scan({})
//To get info about the device
ArmfitSdkManager.getInfo()
//To connect to the identified device
ArmfitSdkManager.connect(id)
// where id -> Periperal id
//To retrieve the services offered by the periperal device
ArmfitSdkManager.retrieveServices(id)
// where id -> Periperal id
//To get on time data from the connected BLE Device
ArmfitSdkManager.getData()
//To get real time data feed from the devive connected
ArmfitSdkManager.getRealTimeData()
//To get the file count and file data results stored in the connected device
ArmfitSdkManager.getFiles()
// Callback handlers for various events
sdkManagerEmitter.addListener('ArmfitSdkModuleDiscoverPeripheral',handleDiscoverPeripheral);
sdkManagerEmitter.addListener('ArmfitSdkModuleDeviceState',handleDevicestate);
sdkManagerEmitter.addListener('ArmfitSdkModuleStopScan', handleStopScan);
sdkManagerEmitter.addListener('ArmfitSdkModuleResult', notifyServices);
sdkManagerEmitter.addListener('ArmfitSdkModuleFileCountResult',fileListServices);
sdkManagerEmitter.addListener('ArmfitSdkModuleFile', fileReadService);
```
## Supported Device

## Contributing
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
## License
MIT