0

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

  • Can you please enable MoEngage SDK logs and share the logs with us so that we can see what exactly is wrong. Also it will be great if you can mention the platform(Android/iOS) on which you are running the application it will help us debug faster. How to enable logs? Android: https://docs.moengage.com/docs/troubleshooting-1#section--q-how-to-enable-moengage-sdk-s-debug-logs-for-unsigned-builds- iOS: https://docs.moengage.com/docs/troubleshooting#section-enable-sdk-logs – Umang Jun 08 '19 at 06:26
  • Note: Logs might have some sensitive data based on what you have tracked and might not be suitable for this platform. In that case you can drop us an email to support@moengage.com – Umang Jun 08 '19 at 06:26
  • Sure, I'll try to do that asap, can I get the filter for logcat? (To only see moengage logs) – Oscar Colmenares Jun 08 '19 at 21:37

1 Answers1

0

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}