quarvis-device-sdk-react-native
v0.1.3
Published
Quarvis Health device SDK for React Native
Downloads
248
Readme
quarvis-device-sdk-react-native
Quarvis Health device SDK for React Native
Installation
npm install quarvis-device-sdk-react-native
cd ios && pod install
Add the following to your ios/Your-App/Info.plist
:
<plist version="1.0">
<dict>
<!-- ... rest of your properties-->
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string>We need location access to use Bluetooth for connecting to devices.</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>We use Bluetooth to connect to nearby devices for enhanced functionality.</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Bluetooth access is required to communicate with nearby devices.</string>
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-central</string>
<string>bluetooth-peripheral</string>
</array>
</dict>
</plist>
Add the following to your android/app/proguard-rules.pro
:
-keep class com.quarvis.** { *; }
Add the following to your android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourapp">
<!-- ... -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Android 12 specific permissions -->
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
</manifest>
Usage
import { isBluetoothEnabled } from 'quarvis-device-sdk-react-native';
// ...
const result = await isBluetoothEnabled();
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library