Skip to content

Commit 93c8324

Browse files
committed
add support to local js
1 parent 66a7e23 commit 93c8324

File tree

1 file changed

+6
-1
lines changed
  • analytics-kotlin-live/src/main/java/com/segment/analytics/liveplugins/kotlin

1 file changed

+6
-1
lines changed

analytics-kotlin-live/src/main/java/com/segment/analytics/liveplugins/kotlin/LivePlugins.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ data class LivePluginsSettings(
3939
class LivePlugins(
4040
private val fallbackFile: InputStream? = null,
4141
private val forceFallbackFile: Boolean = false,
42-
exceptionHandler: JSExceptionHandler? = null
42+
exceptionHandler: JSExceptionHandler? = null,
43+
private val localJS: List<InputStream> = listOf()
4344
) : EventPlugin, WaitingPlugin {
4445
override val type: Plugin.Type = Plugin.Type.Utility
4546

@@ -135,6 +136,10 @@ class LivePlugins(
135136
d.prepare(engine)
136137
}
137138
engine.launch (global = true) {
139+
for (js in localJS) {
140+
loadBundle(js)
141+
}
142+
138143
loadBundle(file.inputStream()) { error ->
139144
if (error != null) {
140145
analytics.log(error.message ?: "")

0 commit comments

Comments
 (0)