Skip to content

Commit

Permalink
Merge branch 'release/6.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mscwilson committed Feb 1, 2024
2 parents c6ad42b + 2bae43a commit 18cdf59
Show file tree
Hide file tree
Showing 306 changed files with 2,327 additions and 701 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
Version 6.0.0 (2024-02-01)
--------------------------
Enable lifecycle autotracking by default (#651)
Update copyright notices (#669)
Add API to decorate link with user/session info (#639)
Add an option to override platform context properties (#667)
Tidy AbstractEvent internal properties (#666)
Handle errors when fetching screen resolution in Subject (#657)
Undeprecate PageView event (#665)
Fix demo crash when using R8 full mode (#652)
Add configurable limit for the maximum age and number of events in the event store and remove old events before sending (#660)
Remove optional types in event store interface (#661)
Set default thread count in Executor to match the default thread pool size in the Emitter (#659)
Remove unused threadCount property from Tracker (#659)
Fix returning error from network connection requests (#659)
Change default emit timeout from 5 seconds to 30 seconds (#658)
Update Emitter constructor to accept namespace and event store and make them immutable (#659)
Do not track the screen view again when app comes to foreground (#653)
Add screen engagement tracking of time spent and list items scrolled on a screen (#654)
Make network requests serially in network connection (#646)
Change default buffer option to single (#649)
Flush events only when the buffer is full (#648)

Version 5.6.0 (2023-10-12)
--------------------------
Add configuration to send requests with user ID to a Focal Meter endpoint (#571)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2023 Snowplow Analytics Ltd.
Copyright 2015-present Snowplow Analytics Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Three demo apps are included in this repository: one in [Java](https://github.co

## Copyright and license

The Snowplow Android Tracker is copyright 2015-2023 Snowplow Analytics Ltd.
The Snowplow Android Tracker is copyright 2015-present Snowplow Analytics Ltd.

Licensed under the **[Apache License, Version 2.0][license]** (the "License");
you may not use this software except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.6.0
6.0.0
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ plugins {

subprojects {
group = 'com.snowplowanalytics'
version = '5.6.0'
version = '6.0.0'
repositories {
google()
maven {
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ systemProp.org.gradle.internal.http.socketTimeout=120000
SONATYPE_STAGING_PROFILE=comsnowplowanalytics
GROUP=com.snowplowanalytics
POM_ARTIFACT_ID=snowplow-android-tracker
VERSION_NAME=5.6.0
VERSION_NAME=6.0.0

POM_NAME=snowplow-android-tracker
POM_PACKAGING=aar
Expand All @@ -50,3 +50,4 @@ POM_LICENCE_DIST=repo

POM_DEVELOPER_ID=snowplow
POM_DEVELOPER_NAME=Snowplow Analytics
android.enableR8.fullMode=true
8 changes: 7 additions & 1 deletion snowplow-demo-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ android {

buildTypes {
release {
minifyEnabled false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand Down Expand Up @@ -60,6 +61,11 @@ dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':snowplow-android-tracker')

implementation 'com.google.android.gms:play-services-appset:16.0.2'
implementation 'com.google.android.gms:play-services-ads:22.6.0'
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation "com.android.installreferrer:installreferrer:2.2"

implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-gson:2.0.0"
Expand Down
17 changes: 16 additions & 1 deletion snowplow-demo-compose/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,19 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

# Fixes R8 full mode crash
# Also see https://github.com/square/retrofit/issues/3751
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

# Reflection for the appSetId
-keep class com.google.android.gms.appset.AppSet { *; }
-keep class com.google.android.gms.appset.AppSetIdInfo { *; }
-keep class com.google.android.gms.internal.appset.zzr { *; }
-keep class com.google.android.gms.tasks.Tasks { *; }

# Reflection for the AAID (AndroidIdfa)
-keep class com.google.android.gms.ads.identifier.** { *; }
5 changes: 4 additions & 1 deletion snowplow-demo-compose/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Snowplowandroidtracker">
<!-- Sample Ad Manager app ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>
<activity
android:name=".MainActivity"
android:exported="true"
Expand All @@ -24,5 +28,4 @@
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.snowplowanalytics.snowplow.configuration.NetworkConfiguration
import com.snowplowanalytics.snowplow.configuration.TrackerConfiguration
import com.snowplowanalytics.snowplow.controller.TrackerController
import com.snowplowanalytics.snowplow.emitter.BufferOption
import com.snowplowanalytics.snowplow.event.ListItemView
import com.snowplowanalytics.snowplow.event.ScreenView
import com.snowplowanalytics.snowplow.network.HttpMethod
import com.snowplowanalytics.snowplow.payload.SelfDescribingJson
Expand All @@ -20,7 +21,9 @@ object Tracking {
fun setup(namespace: String) : TrackerController {
// Replace this collector endpoint with your own
val networkConfig = NetworkConfiguration("https://23a6-82-26-43-253.ngrok.io", HttpMethod.POST)
val trackerConfig = TrackerConfiguration("appID").logLevel(LogLevel.DEBUG)
val trackerConfig = TrackerConfiguration("appID")
.logLevel(LogLevel.DEBUG)
.screenViewAutotracking(false)
val emitterConfig = EmitterConfiguration().bufferOption(BufferOption.Single)

return Snowplow.createTracker(
Expand All @@ -44,7 +47,16 @@ object Tracking {
entities: List<SelfDescribingJson>? = null,
) {
LaunchedEffect(Unit, block = {
val event = ScreenView(screenName).entities(entities)
val event = ScreenView(screenName)
entities?.let { event.entities(it) }
Snowplow.defaultTracker?.track(event)
})
}

@Composable
fun TrackListItemView(index: Int, itemsCount: Int?) {
LaunchedEffect(Unit, block = {
val event = ListItemView(index, itemsCount)
Snowplow.defaultTracker?.track(event)
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ fun SchemaDetailScreen(
"iglu:com.snowplowanalytics.iglu/anything-a/jsonschema/1-0-0",
hashMapOf("name" to schemaParts.name, "vendor" to schemaParts.vendor)
)
Tracking.ManuallyTrackScreenView("schema_detail", entities = listOf(entity))


Scaffold(
topBar = {
TopAppBar(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.material.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowForward
Expand All @@ -16,6 +17,7 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.snowplowanalytics.snowplowdemocompose.R
import com.snowplowanalytics.snowplowdemocompose.data.SchemaUrlParts
import com.snowplowanalytics.snowplowdemocompose.data.Tracking

@Composable
fun SchemaListScreen(
Expand All @@ -38,7 +40,11 @@ fun SchemaListScreen(
if (vm.errorMessage.isEmpty()) {
Column(modifier = Modifier.padding(contentPadding)) {
LazyColumn(modifier = Modifier.fillMaxHeight()) {
items(vm.schemaPartsList) { schema ->
itemsIndexed(vm.schemaPartsList) { index, schema ->
Tracking.TrackListItemView(
index = index,
itemsCount = vm.schemaPartsList.size
)
SchemaCard(schema = schema, onClick = onSchemaClicked)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down Expand Up @@ -295,9 +295,7 @@ private boolean setupWithLocalConfig() {
NetworkConfiguration networkConfiguration = new NetworkConfiguration(uri, method);
EmitterConfiguration emitterConfiguration = new EmitterConfiguration()
.requestCallback(getRequestCallback())
.bufferOption(BufferOption.DefaultGroup)
.threadPoolSize(20)
.emitRange(500)
.byteLimitPost(52000);
TrackerConfiguration trackerConfiguration = new TrackerConfiguration(appId)
.logLevel(LogLevel.VERBOSE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
11 changes: 10 additions & 1 deletion snowplow-demo-kotlin/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,13 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

# Reflection for the appSetId
-keep class com.google.android.gms.appset.AppSet { *; }
-keep class com.google.android.gms.appset.AppSetIdInfo { *; }
-keep class com.google.android.gms.internal.appset.zzr { *; }
-keep class com.google.android.gms.tasks.Tasks { *; }

# Reflection for the AAID (AndroidIdfa)
-keep class com.google.android.gms.ads.identifier.** { *; }
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down Expand Up @@ -260,9 +260,8 @@ class Demo : Activity(), LoggerDelegate {
val networkConfiguration = NetworkConfiguration(uri, method)
val emitterConfiguration = EmitterConfiguration()
.requestCallback(requestCallback)
.bufferOption(BufferOption.DefaultGroup)
.bufferOption(BufferOption.SmallGroup)
.threadPoolSize(20)
.emitRange(500)
.byteLimitPost(52000)
val trackerConfiguration = TrackerConfiguration(appId)
.logLevel(LogLevel.VERBOSE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down Expand Up @@ -46,4 +46,3 @@ class VideoView : android.widget.VideoView {
viewController?.onSeekStart()
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down Expand Up @@ -178,4 +178,3 @@ class VideoViewController(activity: Activity, uri: Uri) {
private val TAG = VideoViewController::class.java.simpleName
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand All @@ -24,14 +24,21 @@ class AbstractEventTest {
@Test
fun testAddsEntitiesUsingAllAPIs() {
val event = ScreenView("screen")
val entity1 = SelfDescribingJson("schema1", "data1")
val entity2 = SelfDescribingJson("schema2", "data2")
val entity3 = SelfDescribingJson("schema3", "data3")

event.entities.add(SelfDescribingJson("schema1", "data1"))
event.customContexts.add(SelfDescribingJson("schema2", "data2"))
event.entities(listOf(SelfDescribingJson("schema3", "data3")))
event.contexts(listOf(SelfDescribingJson("schema4", "data4")))

Assert.assertEquals(4, event.entities.count())
Assert.assertEquals(4, event.contexts.count())
Assert.assertEquals(4, event.customContexts.count())
event.entities.add(entity1)
Assert.assertEquals(1, event.entities.count())

event.entities(listOf(entity2))
Assert.assertEquals(2, event.entities.count())

event.contexts(listOf(entity3))
Assert.assertEquals(3, event.entities.count())
Assert.assertEquals(3, event.contexts.count())
Assert.assertTrue(event.entities.contains(entity1))
Assert.assertTrue(event.entities.contains(entity2))
Assert.assertTrue(event.entities.contains(entity3))
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Loading

0 comments on commit 18cdf59

Please sign in to comment.