File tree Expand file tree Collapse file tree 7 files changed +14
-8
lines changed
src/main/java/com/segment/analytics/liveplugins/kotlin Expand file tree Collapse file tree 7 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 28
28
- name : Grant execute permission for gradlew
29
29
run : chmod +x gradlew
30
30
- name : cache gradle dependencies
31
- uses : actions/cache@v2
31
+ uses : actions/cache@v3
32
32
with :
33
33
path : |
34
34
~/.gradle/caches
Original file line number Diff line number Diff line change 27
27
- name : Grant execute permission for gradlew
28
28
run : chmod +x gradlew
29
29
- name : cache gradle dependencies
30
- uses : actions/cache@v2
30
+ uses : actions/cache@v3
31
31
with :
32
32
path : |
33
33
~/.gradle/caches
Original file line number Diff line number Diff line change 13
13
- name : Grant execute permission for gradlew
14
14
run : chmod +x gradlew
15
15
- name : cache gradle dependencies
16
- uses : actions/cache@v2
16
+ uses : actions/cache@v3
17
17
with :
18
18
path : |
19
19
~/.gradle/caches
Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ android {
33
33
34
34
dependencies {
35
35
// Segment
36
- implementation ' com.segment.analytics.kotlin:substrata:1.0 .0'
37
- implementation ' com.segment.analytics.kotlin:android:1.16.3 '
36
+ implementation ' com.segment.analytics.kotlin:substrata:1.1 .0'
37
+ implementation ' com.segment.analytics.kotlin:android:1.20.0 '
38
38
39
39
implementation ' org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1'
40
40
implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1'
Original file line number Diff line number Diff line change
1
+ -keep class com.segment.analytics.liveplugins.kotlin.** { *; }
Original file line number Diff line number Diff line change @@ -131,8 +131,13 @@ class JSAnalytics {
131
131
132
132
fun add (plugin : JSObject ): Boolean {
133
133
if (! mainAnalytics) return false // Only allow adding plugins to injected analytics
134
-
135
134
val type: Plugin .Type = pluginTypeFromInt(plugin.getInt(" type" )) ? : return false
135
+
136
+ // persist plugin in the global scope to avoid being garbage collected
137
+ engine.sync {
138
+ this [plugin.ref.toString()] = plugin
139
+ }
140
+
136
141
var result = false
137
142
val livePlugin = LivePlugin (plugin, type, engine)
138
143
val destination = plugin[" destination" ]
Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ android {
35
35
36
36
dependencies {
37
37
implementation project(' :analytics-kotlin-live' )
38
- implementation ' com.segment.analytics.kotlin:substrata:1.0 .0'
39
- implementation ' com.segment.analytics.kotlin:android:1.16 .0'
38
+ implementation ' com.segment.analytics.kotlin:substrata:1.1 .0'
39
+ implementation ' com.segment.analytics.kotlin:android:1.20 .0'
40
40
implementation ' androidx.core:core-ktx:1.13.0'
41
41
implementation ' androidx.appcompat:appcompat:1.6.1'
42
42
implementation ' com.google.android.material:material:1.11.0'
You can’t perform that action at this time.
0 commit comments