10-14-2017 07:40
10-14-2017 07:40
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.
10-15-2017 14:49
10-15-2017 14:49
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,
10-14-2017 07:42
10-14-2017 07:42
The error when calling console.log(JSON.stringify on the object is:
** ERROR: Could not convert log string **
10-14-2017 09:38
10-14-2017 09:38
@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.
10-14-2017 11:33
10-14-2017 11:33
@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?
10-15-2017 14:49
10-15-2017 14:49
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,