getSteps return empty array
See original GitHub issueAs @ibraude mentioned before I still get the empty array. It works on both android & IOS like authorizaiton etc. but when I get results of steps its just empty array. I thought it could be cuz of simulator but I test it in real device now, looks same…
Permissions:
const permissions = [
{
kind: Fitness.PermissionKind.Step,
access: Fitness.PermissionAccess.Read
},
];
Can anyone help about it?
Issue Analytics
- State:
- Created 3 years ago
- Comments:22 (9 by maintainers)
Top Results From Across the Web
Not able to get Steps Data, show's empty array - Bountysource
I'm having trouble getting steps data. I'm using the getDailyStepCountSamples function, but the results is returning an empty array instead.
Read more >React Native HealthKit getDailyStepCountSamples returning ...
... getDailyStepCountSamples returning undefined or empty array ... Once I initiate HealthKit again, it will return 'undefined' AND log ...
Read more >High-Level APIs — ADIOS2 2.8.3 documentation
Empty constructor, allows the use of open later in the code ... isLocalValue – true: local value (returned as GlobalArray), false: global value...
Read more >Empty arrays | Practice Problems - HackerEarth
Java Solution for Empty Arrays ... return 1 + getSteps(n-1, a.slice(1), b.slice(1)); } else { a = rotateArray(a); return 1 + getSteps(n, a, ......
Read more >Variable Types: Arrays And Tables - Dev Center - Electric Imp
local arrayOne = array(); // Array creator function, initially empty local arrayTwo ... Calling typeof on an array returns the string "array" ....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey, thought this might be related. So to be able to record steps\activity on Google Fit you must call the
Fitness.subscribeToSteps()
orFitness.subscribeToActivity()
.if these methods return false (failed to subscribe) it probably means the app doesn’t have the required permissions, because as of Android 10 I think, physical activity is defined as a sensitive permission and requires Android permissions to be granted. (see https://developers.google.com/fit/android/authorization#requesting_android_permissions )
To solve this, use
react-native-permissions
to request for theACTIVITY_RECOGNITION
permission.It can be used like this:
I’ll try and open a PR to add this functionality.
Hope this helps in the meantime
Ugh, never mind right after posting this it started working 😄 Seems like there’s quite a delay in data syncing
I’m having the same unexpected result:getSteps()
yields an empty array. I’m trying to fetch tracked steps on Android Emulator without having Google Fit app installed. I am leveragingsubscribeToSteps()
method as documentation suggests. I am certain that I have some steps tracked in given period because I can see them on Google Fit app that I have installed on my physical phone and I can confirm that permissions are successfully granted since my emulated app appears in Google Fit settings under “Third-party apps with account access”.I could swear it did work when I last worked on the project couple a weeks ago… Did Google change something on their end? @Francesco-VotoThis is my control flow (simplified):