On the Ionic I am finding the JSON.stringify fails if the outermost object is an array. I can itterate through the collection and print each one to console, and in the companion I can call JSON.stringify, but it fails on the Ionic. Is there any way around this other than itterating? I'm developing and it is nice to be able to stringify the raw data. The json looks like below, just more elements but still well below the 1027 byte limit.
[{"DisplayText":"Server 1","Status":"Online"}, {"DisplayText":"Server 2","Status":"Offline"}]
Answered! Go to the Best Answer.
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.
I'm not sure exactly what the device limit is, but it's definitely shorter than the companion.
You could experiment with different lengths to see which works,
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.
@SkipFire wrote:
The error when calling console.log(JSON.stringify on the object is:
** ERROR: Could not convert log string **
Essentially the string is too long to output to the console. This is fixed in the next version, it will truncate automatically.
@JonFitbit, so is the limit shorter for the Ionic than for the companion? The same string can be stringified on the companion with no problem. What is the limit for the console.log on the Ionic?
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.
I'm not sure exactly what the device limit is, but it's definitely shorter than the companion.
You could experiment with different lengths to see which works,