-
Notifications
You must be signed in to change notification settings - Fork 21
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
Can't set enableForegroundTracking
on Android
#119
Comments
Thanks for sharing your feedback and the workaround. |
Hello @pdsouza |
@ydv0121 Sure, I think the simplest way is to just add some initialization code in your MainActivity's
This React Native library just delegates calls down to the native Android Amplitude instance so with the above code it'll have foreground tracking enabled without you needing to set it from RN. If you need precise control over when you enable foreground tracking, another option is to create a native module and expose a method Hope this helps! |
@pdsouza Thanks a ton. it helped me. @yuhao900914 i think its highly required this method in react-native sdk too. |
Hello! Thanks for your work maintaining a React Native library for Amplitude!
I noticed that the React Native SDK doesn't expose the
enableForegroundTracking
method, which is highly recommended on Android for accurate session tracking according to the docs.I can work around this by enabling it in the native code but it would be great to expose this in React Native as well. Developers who aren't familiar with the SDK may not even know that they are missing out on this on Android.
The text was updated successfully, but these errors were encountered: