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

passing integration object in track method #913

Closed mohit23x closed 4 months ago

mohit23x commented 5 months ago

Steps to reproduce

v2 link - https://github.com/segmentio/analytics-react-native/blob/87f34e3ae318f85666ef1b8b94b5646e138bda17/packages/core/src/analytics.ts#L545

v1 link - https://github.com/segmentio/analytics-react-native/blob/cf11d270e163ecc9661a15f0851215160af67796/packages/core/src/analytics.ts#L271

track v2 (new) track v1 (old)
image image
oscb commented 4 months ago

@mohit23x we don't support integrations as an argument on v2. That's by design. By default AppsFlyer should be getting all the settings it needs from Segment settings:

https://github.com/segmentio/analytics-react-native/blob/3862b4ec6b3cf26c490fda79f322e05ee6fc7cb1/packages/plugins/plugin-appsflyer/src/types.ts#L1-L9

You can also pass the same settings object when adding the plugin:

segmentClient.add({plugin: new AppsflyerPlugin(), settings: {
  // Here
}});

I do recommend doing it all through Segment to have more flexibility as those get updated through the cloud.