Closed arthurgeron-work closed 1 year ago
Javascript has an Infinity
, but Swift/Objective C does not. When your React code is compiled into native code, it can no longer deal with the infinity, so it crashes – as your error message says, not usable as a native method argument
. I think you can reproduce this even more easily by simply trying to console.log()
an Infinity, or an object containing Infinity.
@arthurgeron-work what @ary31415 mentioned is very likely the case.
I might suggest instead setting it to 0
to prevent any flushes. I believe we ignore any number below 0
when setting flush policies
@oscb It may be a good idea to add that to the docs. Thank you.
analytics-react-native
version: 2.14.0Steps to reproduce
Setup your segment client with the following param
flushInterval: __DEV__ ? Infinity : undefined
, where DEV is true for a development environmentTry tracking an event
Expected behavior
trackEvent(...
should be called; events shouldn't ever be sent because of flush interval (maybe there's a better way not to send segment data in dev env?)Actual behavior![image](https://github.com/segmentio/analytics-react-native/assets/71399856/9fd37fce-469d-4e85-9785-3541a4dacfab)