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 2828 - name : Grant execute permission for gradlew
2929 run : chmod +x gradlew
3030 - name : cache gradle dependencies
31- uses : actions/cache@v2
31+ uses : actions/cache@v3
3232 with :
3333 path : |
3434 ~/.gradle/caches
Original file line number Diff line number Diff line change 2727 - name : Grant execute permission for gradlew
2828 run : chmod +x gradlew
2929 - name : cache gradle dependencies
30- uses : actions/cache@v2
30+ uses : actions/cache@v3
3131 with :
3232 path : |
3333 ~/.gradle/caches
Original file line number Diff line number Diff line change 1313 - name : Grant execute permission for gradlew
1414 run : chmod +x gradlew
1515 - name : cache gradle dependencies
16- uses : actions/cache@v2
16+ uses : actions/cache@v3
1717 with :
1818 path : |
1919 ~/.gradle/caches
Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ android {
3333
3434dependencies {
3535 // 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 '
3838
3939 implementation ' org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1'
4040 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 {
131131
132132 fun add (plugin : JSObject ): Boolean {
133133 if (! mainAnalytics) return false // Only allow adding plugins to injected analytics
134-
135134 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+
136141 var result = false
137142 val livePlugin = LivePlugin (plugin, type, engine)
138143 val destination = plugin[" destination" ]
Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ android {
3535
3636dependencies {
3737 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'
4040 implementation ' androidx.core:core-ktx:1.13.0'
4141 implementation ' androidx.appcompat:appcompat:1.6.1'
4242 implementation ' com.google.android.material:material:1.11.0'
You can’t perform that action at this time.
0 commit comments