react-native-radar
react-native-radar copied to clipboard
Events not emitting properly
Hi, I integrated the package in my Android application. The "In App" events do not seem to trigger at the correct moment and the correct place in the Geofence.
Events behave abnormally - trigger sometimes and do not trigger sometimes.
Kindly help
Can you share some relevant bits of code from your app? Are you tracking (startTracking()
), and if so, what tracking options are you using?
Thankyou for the response
No i am not calling the startTracking() instead calling the below
Radar.trackOnce() .then(result => { console.log('trackOnce:', result); }) .catch(err => { console.log('trackOnce:', err); });
Radar.on('events', result => { this.setState({ events: result.events, }); });
Radar should send an "enter event" in the app when a Fence is entered and an "exit event" when the fence is exited.
The simulate feature in the "React native radar website dashboard" seems to fire the events accurately, but it is just the In App events don't seem to trigger properly. Not sure if i am doing something wrong. Kindly help
Can you try making your Radar.on()
call before calling Radar.trackOnce()
? It's possible that the events are being fired before your handler is registered for them.
@OmarGulzar - If you are still having issues here, please file a new issue. In that please provide the following:
- Confirmation you are initializing Radar in both native code and in react native (
Radar.initialize()
) - You have configured the listeners outside of any view components.
Beyond this, I recommend testing other Radar listeners including the error and location listeners: https://radar.com/documentation/sdk/react-native#background-tracking. The dashboard simulator does not trigger events on the associated device (meant for testing dashboard configured integrations) and events only occur when Radar events fire.