0.0.13 • Published 4 years ago

react-native-fitness-watcher v0.0.13

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

react-native-fitness-watcher

NOTE: This is a package for custom fitness watch and cannot be use for other BLE devices.

Getting started

$ npm install react-native-fitness-watcher --save

Mostly automatic installation (Skip this step for React Native 0.60 and above.)

$ react-native link react-native-fitness-watcher

Manual installation

iOS (Skip this step for React Native 0.60 and above.)

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-fitness-watcher and add FitnessWatcher.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libFitnessWatcher.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android (Skip this step for React Native 0.60 and above.)

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  • Add import com.reactlibrary.FitnessWatcherPackage; to the imports at the top of the file
  • Add new FitnessWatcherPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-fitness-watcher'
    project(':react-native-fitness-watcher').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-fitness-watcher/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-fitness-watcher')

Usage

import FitnessWatcher from 'react-native-fitness-watcher';

IMPORTANT: YOU MUST ALSO ENSURE THAT THE PROPER PERMISSIONS MUST BE GRANTED FOR THE MODULE TO WORK.
FOR ANDROID PERMISSIONS, ACCESS_COARSE_LOCATION ACCESS_FINE_LOCATION
Refer to https://facebook.github.io/react-native/docs/permissionsandroid on how to prompt user for permissions.

//Initialize the Fitness Watcher
FitnessWatcher.initializeFitnessWatcher()

//Get list of devices (The device's name is most likely L8-R7) 
FitnessWatcher.getListOfDevices((callbackResult => (return callbackResult)))

//Connect to device with deviceAddress
FitnessWatcher.connectToBLEDevice(deviceAddress: string, (callbackResult => (return callbackResult)))
0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

5 years ago