Community Forums

Where our customers, developers, and more can come together to help each other with both general and technical questions about our products and services.

React Native Custom Events


Hi Guys,

I'm looking into capturing Airship Events in React Native.

So I'm using the following code:

import { UrbanAirship, UACustomEvent } from 'urbanairship-react-native'
const event = newUACustomEvent("home", "test");
However, the data does not seem to be appearing on the Reporting Panel whenever I log in (Reports > Event Tracking).  On the iOS and Android docs, I noticed an extra method called track().  In my example here, it would be event.track().  However, this doesn't not appear for React Native Library.  Can anyone think of any reason why my event isn't showing on the reporting?  No errors on the console.
I've checked the sample code on Github:
They import the UACustomEvent, but they don't use anywhere on the code base.

Please sign in to leave a comment.


Hi Eric,

Thanks for this.  Yes, this is working for me now.  Sorry I do have a quick additional question from me on this, if I wanted to capture the Named User with the Event?  How would I approach this?

For example, I have the following code snippet:

const event = new UACustomEvent(screen);
event.addProperty("namedUser", namedUser);

However, whenever I check the reporting.  Reports -> Event Tracking.  I don't see any additional properties.  I did look at adding this:
However, I don't see where that data is being passed into the reporting?
darren 0 votes
Comment actions Permalink