betaacid / expo-analytics

Google Analytics integration for use with React Native apps built on Expo
MIT License
288 stars 62 forks source link

Package not working for bare workflow apps #40

Open beaur opened 5 years ago

beaur commented 5 years ago

It seems this library uses the expo-constants package and reads values from the Constants.manifest object. Constants.manifest is null on bare apps so the package throws errors. Not sure if this should be addressed here or in the expo-constants library.

ryanvanderpol commented 5 years ago

@beaurushton if you're using a version of the Expo SDK that is 32 or lower, try pinning your package.json to import v1.0.8 of this package. It seems likely that the problem you're reporting is due to changes in #35 to support SDK33+

AdamGerthel commented 4 years ago

You could use this package instead. Seems the API is identical: https://github.com/ryanvanderpol/react-native-googleanalytics

btk commented 4 years ago

@ryanvanderpol this is valid issue;

The manifest comes as empty, maybe we can check if manifest is empty at analytics.js and ask user to pass the data used from manifest, (name, slug, version) via additionalParameters, and fallback to it.

We can put a warning in the console everytime screenhit or hit is called. What do you think? i can send a pr.

linaia commented 4 years ago

Hi, any updates on this ? using this package for expo only and another one for ejected (bare react-native) is the only solution ?

ryanvanderpol commented 4 years ago

Happy to accept a PR on this one! I've abandoned Expo and have just been using bare RN for all my recent projects so I haven't had a good opportunity to reproduce this one.