segmentio / analytics-react-native

The hassle-free way to add analytics to your React-Native app.
https://segment.com/docs/sources/mobile/react-native/
MIT License
354 stars 181 forks source link

createClient calling multiple times when app being killed status to foreground #890

Open ravi-tally opened 8 months ago

ravi-tally commented 8 months ago

Steps to reproduce

const segmentClient = createClient({
      writeKey,
      trackAppLifecycleEvents: true,
      collectDeviceId: true,
      debug: true,
      trackDeepLinks: true,
    });

segmentClient.userInfo.get()?.anonymousId

it means every lunch time this method call again and create a new anonymousId

While I have integrated older version 1.5.2 with SegmentAnalytics.useNativeConfiguration(); method, everytime I can get same anonymousId

Expected behavior

Is there any solution for this please share

alanjcharles commented 1 month ago

hi @ravi-tally apologies for the delay here. Is this is still an issue you are experiencing?