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
[Tracker] Support React Native #3182
Comments
Hi @hose314! We have no plans for React Native on our imminent roadmap. Would it look like bindings to our native mobile trackers, or would it be based on our JavaScript Tracker - what do you recommend? If the latter, this might be relevant: |
I'm running into the same issue and thinking where to implement analytics on native or js threads. Existing node/js snowplow trackers are not working out of the box in react-native due to the some incompatible deps. After some experiments with React Native we decided to run in production. Our existing infrastructure tightly depends on snowplow, so we cannot move to another analytics provider and don't want to. So the question is writing native bridge or rewrite js (with support to save events on disc and |
Makes sense @hose314 - have you considered opening a PR into either of the JS Tracker projects to achieve compatibility? |
I checked that core tracker itself is okay with react-native. Node.js tracker falls with |
Thanks @hose314 . @chuwy , @BenFradet - what do you reckon? |
I think it might be weird to point Snowplow users using React to the node tracker so I'd lean towards adapting the js tracker. |
I think Few more advantages:
So if request/axios is the only problem I'd go in that direction. Especially because it should be extremely simple to fix it. But out of curiosity, @hose314, what exactly the problem with snowplow-javascript-tracker and React Native? |
@chuwy from var t = tracker([e], 'myTracker', 'myApp', false); |
@hose314 snowplow-tracker-core is a separate component, you can use it without |
@chuwy thanks, got it. l've bit confused because Eventually, what you think about moving to |
@hose314, yep that's because core and trackers itself reside in same repository, but I'm ok with moving emitter to axios (@alexanderdean?) if this will make it possible to run it on React Native. |
You make a good case @chuwy. Happy with the axios change if everybody else is - it looks like a very popular / widely used library... |
Related to snowplow/snowplow#3182. Axios is http client with ability to run under different environments such as browser or node. Axios is promise based but emitter still takes single callback function due to the backward compatibility.
Hello, what's the situation now? NodeJS tracker good to go in React Native? |
@sunshineo My suggestion is to plug native side tracker. The main advantaged is that the crash events also will be collected to the store |
I tried the NodeJS tracker for React Native but i'm getting "undefined is not an object (evaluating 'emitters[i].input'. Any ideas? |
hey @VanHoutte , feel free to raise this on our Discourse: https://discourse.snowplowanalytics.com/, you'll reach more people there 👍 |
@VanHoutte Did you ever post the question on Discourse? |
Yes I did but no response. I managed to get it working on react native, let me know if you need help |
@VanHoutte That’d be great. How did you manage to get passed the “undefined is not an object (evaluating 'emitters[i].input)” error? I followed the guide and got that as well. I also created a post on discourse and got no reply. https://discourse.snowplowanalytics.com/t/getting-emitters-i-undefined-when-using-the-node-js-tracker-in-react-native/2825 |
I used https://github.com/yanivkalfa/snowplow-react-native-tracker to get it working. I use it as followed:
I hope this helps. PS, it's possible that the formatting of the code is incorrect since i had to remove some blocks. |
@VanHoutte - thanks for the quick reply. I’m noticing some differences between your setup and how it’s setup in the guide. I’ll give this a shot. Looks promising! |
Yeah i know, i had to manually dig through the library in my node_modules to get the correct working setup. Good luck. I can confirm that this works (well at least for me) |
Thanks! I was able to get it working. |
Hi there!
Any plans to support React Native somehow?
The text was updated successfully, but these errors were encountered: