Can anyone suggest an easy way to construct a JSON object that’s one level deep or two… ??
I think a Library would be an overkill for this app. I want to send multiple values in one event in JSON representation inside the DATA payload of the event.
I am planning on using String formatting… But wanted to know if someone has a better idea…
You want your Photon to send events that have definite start (t0) and end (t1) times. So you decide to make (1) a “timestamp” object that stores those two parameters, and (2) an event type label. That’s a two-level JSON object, because the timestamp is an object itself. Let’s say one of your events is like, motion being detected in a room or something. Your JSON could look like: