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.
 
Thanks!
 
Regards,
Darren
 
 
 
 
 

Didn't find what you were looking for?

New post

Comments

2 comments

  • Darren

    I just wanted to check and be sure you added the event as well. The call would look like:

    UrbanAirship.addCustomEvent(customEvent);

    The full docs on the feature you are looking to use can be found here: https://docs.airship.com/platform/react-native/analytics-and-reporting/

    Please let me know if you additional questions.

    Thank you,

    Eric L.
    Technical Support Engineer
    Airship | Portland

    0
  • 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);
    UrbanAirship.addCustomEvent(event);

    However, whenever I check the reporting.  Reports -> Event Tracking.  I don't see any additional properties.  I did look at adding this:
    UrbanAirship.trackScreen(screen)
    However, I don't see where that data is being passed into the reporting?
     
    Regards,
    Darren
    0

Please sign in to leave a comment.