04-17-2018 07:29
04-17-2018 07:29
I am building my first clockface for my new fitbit versa. I receive readings from the geolocation API, but all fields contain zero as the value. It appears that the device believes it is receiving a reading from my phone, but there it is not valid. Even when I cause my phone to pull its location (Google Maps or even the fitbit app), the zero values remain.
I have attempted acquiring the value both from geolocation.getCurrentPosition() and geolocation.watchPosition(); both supply the same zeroed-out readings.
I have Location enabled in package.json, so it shouldn't be a permission issue (there should be an error event in that case).
Sample reading:
{"accuracy":0,"latitude":0,"longitude":0,"altitude":0,"altitudeAccuracy":null,"heading":0,"speed":0}
04-17-2018 07:53
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
04-17-2018 07:53
Does the Fitbit mobile app definitely have access to location information in your phone's privacy settings?
Best Answer04-17-2018 21:29
04-17-2018 21:29
I did check that early on and confirmed that all permissions are granted (including Location). I am developing for Android which displays an entry in the tray every time the GPS is queried.
When I call `geolocation.getCurrentPosition()` at a regular interval, I see the GPS entry appear at the same interval as those calls. When I register listeners with `geolocation.watchPosition()`, the GPS entry never leaves.
As soon as I disable the GPS portion of the app, the GPS entry disappears and remains absent. Clearly, the clockface is triggering the GPS activity, but the values remain zeroed out.
Best Answer04-19-2018 13:30
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
04-19-2018 13:30
Can you put your project, or a minimal sample project onto Github, and I'll take a look on iOS and Android and see what's happening.
Thanks
Best Answer04-20-2018 19:32
04-20-2018 19:32
I have made that version of the clockface available here: https://github.com/joeledwards/iso-plus/tree/location
Let me know if you have any additional questions about the issue.
Best Answer07-13-2018 05:30
07-13-2018 05:30
Did you ever figure this out? I'm having the same issue.
Best Answer07-13-2018 08:23 - edited 07-13-2018 08:28
07-13-2018 08:23 - edited 07-13-2018 08:28
I did get this working eventually. However, every time I pulled the Geo info, it would wake up the GPS. This resulted in a continuous query for GPS info and it ended up being a drain on my phone battery.
I suspect this is only an issue if you are attempting to incorporate this into a watch face.
Here is the app code for the version of the watch face which was pulling geo info successfully:
https://github.com/joeledwards/iso-plus/blob/location/app/index.js
UPDATE:
I needed to add a permission request into my package.json (also available in the above repo at the location branch).
07-27-2018 03:07
07-27-2018 03:07
Joining late at the party but i had a slioghtly different problem with the Companion watchposition.
It alternates between a good reading and zero reading. My ugly solution was ?
if(!("latitude" in **ahem**.coords)){
if(debug)console.log("latitude not defined");
}else{
position = **ahem**
}
Best Answer