Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android compiles but does not send Mux data to Snowflake #118

Open
davidwinograd1 opened this issue Oct 27, 2023 · 4 comments
Open

Android compiles but does not send Mux data to Snowflake #118

davidwinograd1 opened this issue Oct 27, 2023 · 4 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@davidwinograd1
Copy link

davidwinograd1 commented Oct 27, 2023

Hello,

When using the @theoplayer/react-native-analytics-mux package, my code doesn't throw any errors (unlike the other iOS error), but it's been confirmed that the data itself from Mux is not being sent to Snowflake. Please let me know what might be causing this issue! @tvanlaerhoven

"@theoplayer/react-native-analytics-mux": "^1.2.0",
"react-native-theoplayer": "^3.0.2",

Here is the code:

import {useMux} from '@theoplayer/react-native-analytics-mux';

const muxOptions = {
    debug: true,
    data: {
      env_key: MUX_ENV_KEY, // required

      // Site Metadata
      viewer_user_id: userId,

      // Player Metadata
      player_name: playerName,
      player_version: '3.0.1',
      player_init_time: Date.now(),

      // Video Metadata
      video_id: id,
      video_title: title,
      video_duration: player?.duration,
      video_stream_type: isLive ? 'live' : 'on-demand',
      video_producer: creatorId,
      page_type: 'watchpage',
    },
  };

  const [mux, initMux] = useMux(muxOptions);
  
  const onReady = (player) => {
    initMux(player);

    setPlayer(player);

   ...
  };
  
   <THEOplayerView config={playerConfig} onPlayerReady={onReady}>
@tvanlaerhoven
Copy link
Member

Hey @davidwinograd1 do you see the heartbeat logs in your logcat?

2023-10-27 22:41:35.494 6176-6270 MuxStatsEventQueue com.theoplayer.mux.example D sending hb TrackableEvent: BaseQueryData: query: { "xid": "9138214f-8b9d-4e4c-879b-5df77613bc5e", "xwati": "39318",

The connector is open-source, so you could also set a breakpoint in the connector class and see what is going out:

https://github.com/THEOplayer/react-native-theoplayer-analytics/blob/main/mux/android/src/main/java/com/theoplayermux/ReactTHEOplayerMuxModule.kt#L76

Alternatively also check a network trace.

If data is going out, maybe the env_key is not correct?

@tvanlaerhoven tvanlaerhoven self-assigned this Oct 27, 2023
@tvanlaerhoven tvanlaerhoven added the help wanted Extra attention is needed label Oct 27, 2023
@davidwinograd1
Copy link
Author

davidwinograd1 commented Oct 30, 2023

Hi @tvanlaerhoven,

The ENV_KEY is definitely correct because it works in another part of my application where I use React Native Video integrated with Mux.

In terms of the heartbeat logs, I don't believe I see them. For example, adb logcat | grep MuxStatsEventQueue does not return anything, and adb logcat | grep theoplayer shows the following screenshot below, but nothing related to mux. Is there a step I'm missing? The implementation as I've said before is above and the package is definitely installed.

Have other people been able to send data correctly using the instructions at this link?
https://github.com/THEOplayer/react-native-theoplayer-analytics/blob/main/mux/README.md

Screenshot 2023-10-30 at 1 31 15 PM

@tvanlaerhoven
Copy link
Member

Hey @davidwinograd1, yes if the debug flag is enabled like in the example app (https://github.com/THEOplayer/react-native-theoplayer-analytics/blob/main/mux/example/src/App.tsx#L31) you should see all heartbeat logs passing in the logcat output.

Did you try to run the example app (https://github.com/THEOplayer/react-native-theoplayer-analytics/blob/main/mux/example) and check the output here?

You should be able to put a breakpoint in the connector when running from Android Studio, and then check if it goes through the setup. That's the best method to see what's going on I think.
Could it be the connector is unmounted from RN prematurely?

@tvanlaerhoven
Copy link
Member

Hi @davidwinograd1 , did you make progress with this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants