Code Monkey home page Code Monkey logo

Comments (6)

tonyxiao avatar tonyxiao commented on August 19, 2024 2

@vkarpov15 take a look at my module here. https://github.com/tonyxiao/react-native-analytics. it's not an official Segment library yet but I'm happy to help if you run into problems :)

It supports Android as well. And you would use it like so

import Analytics from 'react-native-analytics'
const analytics = Analytics({
  writeKey: process.env.SEGMENT_KEY,
  skipPageCall: true
})

from analytics.js-core.

f2prateek avatar f2prateek commented on August 19, 2024

@vkarpov15 Have you tried getting in touch with the developers of the react native + segment project at https://github.com/smore-inc/react-native-segment-io-analytics? Unfortunately, I don't think any of us are familiar too deeply with the project yet, but let me check in with the team and see we have any suggestions for you.

from analytics.js-core.

vkarpov15 avatar vkarpov15 commented on August 19, 2024

@tonyxiao thanks for the excellent module! I'm unfortunately gonna have to pass though, looking to avoid dealing with native extensions as much as possible because my team doesn't really have anyone who's an expert with both iOS and android dev AFAIK. I ended up settling on hitting the Keen.IO API directly using superagent because keen-js also fails horribly on react native :(

from analytics.js-core.

tonyxiao avatar tonyxiao commented on August 19, 2024

@vkarpov15 there's actually very strong reason to use native modules on mobile in this case rather than using something like analytics-node. We do a lot of mobile specific work that we don't do in other SDKs, including but not limited to 1) batching requests and gzipping to save battery and bandwidth (difference here is more than an order of magnitude btw) 2) saving requests to disk when user is offline 3) auto measure key events essential to the mobile user lifecycle (See https://segment.com/blog/native-mobile-spec/) and collect device properties. You can build all of that yourself on top of something like superagent but it's a ton of work and not easy to get right.

I've shipped a few React Native apps before, it's generally pretty difficult to avoid native modules over time because they are essential for so many core functionalities. You might even have to write one of your own.

from analytics.js-core.

tonyxiao avatar tonyxiao commented on August 19, 2024

@vkarpov15 just curious, did you try using analytics-node by the way?

from analytics.js-core.

vkarpov15 avatar vkarpov15 commented on August 19, 2024

Nope. I'm sure the module does a lot of useful stuff, but none of what you listed matters to me because right now we're just using keen to track HTTP performance, not user behavior.

from analytics.js-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.