diff --git a/packages/core/android/src/main/java/com/segment/analytics/reactnative/core/RNAnalyticsModule.kt b/packages/core/android/src/main/java/com/segment/analytics/reactnative/core/RNAnalyticsModule.kt index 0a6ee2f5c..15e63ebe6 100644 --- a/packages/core/android/src/main/java/com/segment/analytics/reactnative/core/RNAnalyticsModule.kt +++ b/packages/core/android/src/main/java/com/segment/analytics/reactnative/core/RNAnalyticsModule.kt @@ -134,11 +134,17 @@ class RNAnalyticsModule(context: ReactApplicationContext): ReactContextBaseJavaM builder.trackAttributionInformation() } - if(options.hasKey("flushInterval")) { - builder.flushInterval( - options.getInt("flushInterval").toLong(), - TimeUnit.MILLISECONDS - ) + if(options.hasKey("android") && options.getType("android") == ReadableType.Map) { + val androidOptions = options.getMap("android")!! + if(androidOptions.hasKey("flushInterval")) { + builder.flushInterval( + androidOptions.getInt("flushInterval").toLong(), + TimeUnit.MILLISECONDS + ) + } + if(androidOptions.hasKey("collectDeviceId")) { + builder.collectDeviceId(androidOptions.getBoolean("collectDeviceId")) + } } if(options.getBoolean("debug")) {