08-24-2023 04:43
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-24-2023 04:43
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm getting the following message when trying to test my clock face:
[2:29:07 PM] Companion: On message {"isTrusted":false} (companion/index.js:48,3)
[2:29:07 PM] Companion: Latitude: 48.1076184063 Longitude: 11.6960995793 (companion/index.js:36,3)
[2:29:07 PM] Companion: The 'permission' API is not yet supported in the Fitbit OS Simulator. Behavior may not match the documentation or real devices.
[2:29:07 PM] Companion: Error : {} TypeError: Cannot read property 'sunrise' of undefined (companion/index.js:17,3)
I'm fairly new to javascript, and I can't figure out what the bug is. I would be so appreciative of any pointers. Here's my code:
Answered! Go to the Best Answer.

- Labels:
-
JavaScript
Accepted Solutions
08-24-2023 13:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-24-2023 13:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm wondering whether data.sys could be undefined in _queryOWMWeather(). I haven't used that API so I'm not familiar with its response.
Don't worry about the 'permission' message; that's normal on sim.
Gondwana Software

08-24-2023 13:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-24-2023 13:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm wondering whether data.sys could be undefined in _queryOWMWeather(). I haven't used that API so I'm not familiar with its response.
Don't worry about the 'permission' message; that's normal on sim.
Gondwana Software

08-26-2023 07:00
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-26-2023 07:00
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
That was it! I was switching over from an older API and missed that one.
Can you help me understand the "On message {"isTrusted":false}" log?
Is there any issue that it's set to false? I feel like something being trusted should be set to true, but I'm not entirely sure where this is coming from.

08-26-2023 13:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-26-2023 13:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
That's a strange one. It seems to be an undocumented property of MessageEvent. I've never noticed it before (but I haven't looked).
My solution would be not to log it. 😉
Gondwana Software

