elle-health v0.1.0
react-native-kit-health
Health Kit npm-package
Installation (check read-me-instructions.md)
npm install react-native-kit-health
#iOS
add Capability: HealthKit - Due to their sensitive nature, clinical records have additional setup requirements. First, when you enable your app’s HealthKit capabilities, do NOT select the Clinical Health Records checkbox.
add to info.plist: NSHealthShareUsageDescription Our app needs access to your health data to provide personalized fitness tracking. NSHealthUpdateUsageDescription Our app needs to write data to your health data to save your workouts.
refresh provisioning profiles
Android:
add Permissions to manifest:
Add the Google Fit API dependency to your app's build.gradle file: apply plugin: 'com.google.gms.google-services'
dependencies { implementation(platform("com.google.firebase:firebase-bom:32.7.2")) implementation("com.google.firebase:firebase-analytics") implementation 'com.google.android.gms:play-services-fitness:21.0.0' implementation 'com.google.android.gms:play-services-auth:21.0.0' // Check for the latest version implementation "com.google.android.gms:play-services-base:+" }
- emulator with google play services
Usage
- See /example directory and App.tsx (line 76) method handlePress() for usage, but: initiatePackage( ...) = start the package will return an Object that will be used to post to delegate with postMethodSignature = "post-health-activity-data" & getMethodSignature = “get-health-activity-data-request”
- Add google fit authentication App.tsx (line 127) method authGoogleFit()
- Lastly, DebugEventModel should be implemented for logging in return() = recieve log events from KitHealth package
import {
initiateBeaconPackage, cleanUpBeaconPackage, type Amenities, type MessageType, type GetBeaconResult, getBeaconsMethodSignature, BeaconEventModel, DebugEventModel, postBeaconsMethodSignature,
} from '@ellekadfur/kit-health';
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
10 days ago