10-15-2017 08:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-15-2017 08:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
I am following the sample code here:
https://dev.fitbit.com/guides/geolocation/#overview
However, when I tried it, I got a message of "Position Unavailable" and error code is 2. I did request GPS location permission in my package.json. What else am I missing?
Answered! Go to the Best Answer.
Accepted Solutions
10-15-2017 16:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-15-2017 16:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
I would imagine that's how long it takes to get a fix from the satellites. The API doesn't cache any location information, but I assume you could do that yourself to give you the previous location, while you're waiting.
Alternatively, you could initially ask the Companion for its GPS location, then update it when you have the Device coordinates.
10-15-2017 14:37
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-15-2017 14:37
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Are you doing this in the companion app? Could you check the location permissions on your phone? Perhaps you didn't grant the Fitbit app use of your GPS.
One way you can trigger the permissions prompt in the Fitbit mobile app, is to click the "+" button on the home dashboard screen, and try to manually add an exercise.
10-15-2017 15:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-15-2017 15:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I found that every time I started the app, I need to wait 5-10 seconds and then the GPS service will work. This delay is not acceptable for my purpose.
The settings of Fitbit app for location service is for the phone, not for the watch? So that setting shouldn't matter?

10-15-2017 16:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-15-2017 16:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
@dajian888 wrote:
The settings of Fitbit app for location service is for the phone, not for the watch? So that setting shouldn't matter?
It depends if you're using the Device API, or Companion API. The Companion API requires location permission from the mobile device.
10-15-2017 16:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-15-2017 16:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I see. Thanks for the reply. I am using device API to get GPS location. Any insight on why it is not working until I wait about 5-10 seconds after app started?

10-15-2017 16:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-15-2017 16:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
I would imagine that's how long it takes to get a fix from the satellites. The API doesn't cache any location information, but I assume you could do that yourself to give you the previous location, while you're waiting.
Alternatively, you could initially ask the Companion for its GPS location, then update it when you have the Device coordinates.
