radarlabs / react-native-radar

React Native module for Radar, the leading geofencing and location tracking platform
https://radar.com
Apache License 2.0
170 stars 32 forks source link

Allow access to "alternate places" in react native #20

Closed noahtallen closed 6 years ago

noahtallen commented 6 years ago

So far, radar looks really promising! However, it doesn't seem as if the react native bridge supports the ability to see alternate places.

In Radar's documentation for iOS and Android you see the following code: Radar.acceptEventId(event._id, verifiedPlaceId: event.alternatePlaces[0]._id). This indicates that the native SDK event includes an alternatePlaces array. However, in react-native, when listening for events, I see the following data for the event:

entered_place

However, when I view this event online (I verified that the id is the same), I see that it does show alternate places in the portal:

radar online

As you can see in the screenshot, these aren't passed to my react native application's event handler. (See below for code). log is a function I made to display the event data to me as I test it out.

    Radar.on('events', (result: RadarOnEvent) => {
      // do something with result.events, result.user
      result.events.forEach((event: RadarEvent) => {
        log('EVENT: ' + event.type, event)
      })
    })

Interestingly, in the index.js for the react-native-radar module, there is code which allows you to accept or reject an event ID.

I'm not sure if it's a bug or if I haven't configured it properly, but since all the events seem to be firing correctly, I figured I would ask about it here.