Oscar Colmenares
Oscar Colmenares

Reputation: 85

react-native-moengage `TrackEvent` not publishing event to dashboard

I'm setting up the package react-native-moengage in my react-native app. Followed the guidelines here for react-native all the way to tracking events. Yet calling trackEvent on my code does not publish anything and does not throw an error at JS level.

Running on react-native:0.59and react-native-moengage:^3.0.0

Have not done anything weird beyond what is in the documentation, set up a service to call ReactMoE.trackEvent from sagas. I set up logs and indeed trackEvent is getting called

Pretty much this is it

import ReactMoE from 'react-native-moengage'

class MoengageService {
...
constructor() {
    ReactMoE.isExistingUser(true);
  }

  setUser(userId: string, email: string, name: string) {
    ReactMoE.setUserUniqueID(userId);
    ReactMoE.setUserEmailID(email);
    ReactMoE.setUserAttribute('inAppName', name)
  }

  unsetUser() {
      ReactMoE.logout()
  }

  logEvent = (event: string, data = {}) => {
    const timestamp = moment().valueOf()
    const dataToLog = {
      ...data,
      timestamp,
    }
    ReactMoE.trackEvent(event, dataToLog)
  }
...
}

export const instance = new MoengageService()

I also succesfully set up moengage natively thanks to a previous SO question, or so I believe.

I would expect something to appear in the dashboard, it's blank with the big text up top saying I have not received anything in the last hour

How do I get it to push to dashboard?

EDIT

Just for clarification, I am not interested (yet) in push notifications or any of the like, which is why I skipped setting up firebase and everything

Upvotes: 0

Views: 986

Answers (1)

Oscar Colmenares
Oscar Colmenares

Reputation: 85

After Checking the logs and thinking out loud, I noticed the issue was that the dashboard was being misused, we were checking for debug logs on live instead of test.

If you followed the docs and see nothing, try to check which environment are you reading. Test for debug apps, Live for signed apps.

A helpful thing to check logs, adb logcat MoEngage_v${Your moengage native version here}

Upvotes: 1

Related Questions