Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get steps from Google Account without having the Google Fit App #49

Closed
ghost opened this issue Apr 20, 2018 · 2 comments
Closed

Get steps from Google Account without having the Google Fit App #49

ghost opened this issue Apr 20, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 20, 2018

Heya,

I've been implementing your library and I've noticed you've got a start recording functionality.
I was wondering: if you don't have the Google Fit app itself and you are recording using:

GoogleFit.startRecording((callback) => {
  // Process data from Google Fit Recording API (no google fit app needed)
});

Will this pull all the steps from the associated Google Account using the API? Or just the steps recorded from the local device from this moment forwards? From my testing it seems the latter is the most likely.

@asvine-p
Copy link

asvine-p commented Feb 7, 2020

Hello, any update on this ?
I have a similar issue.
I noticed that my app was not getting any results when installing on a new device without googleFit.
I am only using GoogleFit.getDailyStepCountSamples without any location autorisation.

Here is the result I get:
Capture d’écran 2020-02-07 à 11 34 41

When I add
GoogleFit.startRecording(callback);

my app is crashing:

Screenshot_20200207-115121_United H Dev

I don't see any infos about the GPS authorisation in the doc.
Is it mendatory ?

@Sarathphd
Copy link

Use this function
import { View, Text, PermissionsAndroid } from 'react-native'
const runTime = async() => {
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
{
'title': 'ReactNativeCode Location Permission',
'message': 'ReactNativeCode App needs access to your location '
}
)
if (granted === PermissionsAndroid.RESULTS.GRANTED) {

          alert("Location Permission Granted.");
        }
        else {
    
          alert("Location Permission Not Granted");
    
        }
      } catch (err) {
        console.warn(err)
      }      
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants