Skip to content

Commit ddab890

Browse files
authored
Merge pull request #4482 from segmentio/niall/int_rn
Add integration object info for RN
2 parents 771f7c9 + 203e0db commit ddab890

File tree

1 file changed

+27
-0
lines changed
  • src/connections/sources/catalog/libraries/mobile/react-native

1 file changed

+27
-0
lines changed

src/connections/sources/catalog/libraries/mobile/react-native/index.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,5 +682,32 @@ const segmentClient = createClient({
682682
```
683683
### What is the instanceId set in context?
684684
The instanceId was introduced in [V 2.10.1](https://github.com/segmentio/analytics-react-native/releases/tag/%40segment%2Fanalytics-react-native-v2.10.1) and correlates events to a particular instance of the client in a scenario when you might have multiple instances on a single app.
685+
686+
### How do I interact with the integrations object?
687+
The integrations object is no longer part of the Segment events method signature. To access the integrations object and control what destinations the event reaches, you can use a Plugin:
688+
689+
```js
690+
import {
691+
EventType,
692+
Plugin,
693+
PluginType,
694+
SegmentEvent,
695+
} from '@segment/analytics-react-native';
696+
697+
export class Modify extends Plugin {
698+
type = PluginType.before;
699+
700+
async execute(event: SegmentEvent) {
701+
if (event.type == EventType.TrackEvent) {
702+
let integrations = event.integrations;
703+
if (integrations !== undefined) {
704+
integrations['Appboy'] = false;
705+
}
706+
}
707+
//console.log(event);
708+
return event;
709+
}
710+
}
711+
```
685712
## Changelog
686713
[View the Analytics React Native 2.0 changelog on GitHub](https://github.com/segmentio/analytics-react-native/releases){:target="_blank"}.

0 commit comments

Comments
 (0)