
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@yldio/react-native-google-fitness
Advanced tools
A flexible React Native module for Google Fit
For example, you can query history data using Builder-Pattern of DataReadRequest like Android native way!~
const HOUR_MS = 1000 * 60 * 60;
// Setting a start and end date using a range of 1 week before this moment.
const endTime = Date.now();
const startTime = endTime - HOUR_MS * 24 * 7;
const readRequest = new DataReadRequest.Builder()
.aggregate_dataType(DataType.TYPE_STEP_COUNT_DELTA, DataType.AGGREGATE_STEP_COUNT_DELTA)
.bucketByTime(1, TimeUnit.DAYS)
.setTimeRange(startTime, endTime, TimeUnit.MILLISECONDS)
.build();
const result = await Fitness.History.readData(readRequest);
Quite awesome, isn't it?
$ npm install react-native-google-fitness --save
$ react-native link react-native-google-fitness
Append the following lines to android/settings.gradle
:
include ':react-native-google-fitness'
project(':react-native-google-fitness').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-google-fitness/android')
Insert the following lines inside the dependencies block in android/app/build.gradle
:
compile project(':react-native-google-fitness')
Open up android/app/src/main/java/.../MainApplication.java
import com.ybrain.rn.GoogleFitnessPackage;
to the imports at the top of the filenew GoogleFitnessPackage(),
to the list returned by the getPackages()
method.In order to build Android source code, you'll need following SDK setups
Android Support Repository
Android Support Library
Google Play services
Google Repository
Google Play APK Expansion Library
In order for your app to communicate properly with the Google Fitness API Follow steps in https://developers.google.com/fit/android/get-api-key
Enable Google Fit API in your Google API Console. Also you need to generate new client ID for your app and provide both debug and release SHA keys. Another step is to configure the consent screen, etc.
Provide the SHA1 sum of the certificate used for signing your application to Google. This will enable the GoogleFit plugin to communicate with the Fit application in each smartphone where the application is installed.
Example application is included in this repository.
Because Metro-bundler of React-native doesn't support symbolic link dependency, you need workaround as following. (See details in https://medium.com/@andrewdurber/using-react-native-with-symbolic-links-89a8f42a6563)
Link library root to global
react-native-activity-tracker$ npm link
Install node_modules of example
react-native-activity-tracker/example$ npm install
Link global library
react-native-activity-tracker/example$ npm link react-native-activity-tracker
Now you can start RN node server
npm start
0.0.1 - Initial commit
Copyright (c) 2018-present, YBRAIN Inc. sangwoo.maeng@ybrain.com
FAQs
A flexible React native module for Google Fit
We found that @yldio/react-native-google-fitness demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.