Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: cache gradle dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: cache gradle dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: cache gradle dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
Expand Down
4 changes: 2 additions & 2 deletions analytics-kotlin-live/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ android {

dependencies {
// Segment
implementation 'com.segment.analytics.kotlin:substrata:1.0.0'
implementation 'com.segment.analytics.kotlin:android:1.16.3'
implementation 'com.segment.analytics.kotlin:substrata:1.1.0'
implementation 'com.segment.analytics.kotlin:android:1.20.0'

implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1'
Expand Down
1 change: 1 addition & 0 deletions analytics-kotlin-live/consumer-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-keep class com.segment.analytics.liveplugins.kotlin.** { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,13 @@ class JSAnalytics {

fun add(plugin: JSObject): Boolean {
if (!mainAnalytics) return false // Only allow adding plugins to injected analytics

val type: Plugin.Type = pluginTypeFromInt(plugin.getInt("type")) ?: return false

// persist plugin in the global scope to avoid being garbage collected
engine.sync {
this[plugin.ref.toString()] = plugin
}

var result = false
val livePlugin = LivePlugin(plugin, type, engine)
val destination = plugin["destination"]
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ android {

dependencies {
implementation project(':analytics-kotlin-live')
implementation 'com.segment.analytics.kotlin:substrata:1.0.0'
implementation 'com.segment.analytics.kotlin:android:1.16.0'
implementation 'com.segment.analytics.kotlin:substrata:1.1.0'
implementation 'com.segment.analytics.kotlin:android:1.20.0'
implementation 'androidx.core:core-ktx:1.13.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.11.0'
Expand Down