Skip to content

Commit 3b44278

Browse files
authored
fix: check for platform before configuring adId plugin (#714)
Co-authored-by: Alan Charles <[email protected]>
1 parent 004b596 commit 3b44278

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/plugins/plugin-advertising-id/src/AdvertisingIdPlugin.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ import {
66
getNativeModule,
77
} from '@segment/analytics-react-native';
88

9+
import { Platform } from 'react-native';
10+
911
export class AdvertisingIdPlugin extends Plugin {
1012
type = PluginType.enrichment;
1113

1214
configure(analytics: SegmentClient): void {
15+
if (Platform.OS !== 'android') {
16+
return;
17+
}
18+
1319
this.analytics = analytics;
1420
getNativeModule('AnalyticsReactNativePluginAdvertisingId')
1521
?.getAdvertisingId()

0 commit comments

Comments
 (0)