Closed sesm closed 2 years ago
Hi
I tried the same approach. The problem is that this won't work reliably.
This library is initialized in react native code which is sometimes too late to catch Application installed events (mainly on iOS). It's kind of a race condition. Once you init it and enable the application lifecycle config it might be already after the install event.
The way we solved this was by tracking these events ourselves in javascript. I can share the module with you if you are interested.
@BenBach That's interesting, could you please share the module with me? Thanks!
@sesm Sorry for the delay.
I uploaded the code we are using to a new repository. There is still one bug that the Application Install event is fired twice this but should be easy to catch. We didn't bother with it much since we group by user id and anonymous id anyway
@BenBach thanks a lot!
Add option to enable application lifecycle events tracking. The third argument to
setup
method is added as a Map, for future extensibility. Tested on both iOS and Android.