0
votes

I have one Geo trigger and I want to read the data placed in event property of that trigger.

How can I read this data before my application sends the event data alongwith devicecontext to the server? Is there any way to send few parameters to my callback function?

  var trigger1 = {
              type: "DwellInside",
              circle: {
                longitude: 88.41, 
                latitude: 22.58,   
                radius: 100000 // 100km
              },
              dwellingTime: 100,
              confidenceLevel: "high", // high confidence that we are in the circle
              callback: this.myFunction,
              eventToTransmit: {
                event: {
                  city: "data.city"   // dynamically added using JSON data.
                },
                transmitImmediately: true
              }
            };
1

1 Answers

1
votes

The callback function only receives back the device context when the trigger fires. If you'd like additional information, you could code it for example into a "wrapper" function - for example:

callback: function(deviceCtx) { myFunction("data.city", deviceCtx); },