Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
fix(android): parse android specific options correctly (segmentio#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
prayansh authored Jun 15, 2020
1 parent 2cc2502 commit 49e4815
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down

0 comments on commit 49e4815

Please sign in to comment.