Skip to content

Commit

Permalink
Merge branch 'release/6.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
mscwilson committed Jun 12, 2024
2 parents 07536ea + 1e15289 commit fa694a5
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 31 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push]

jobs:
test:
runs-on: macos-latest
runs-on: ubuntu-latest

strategy:
fail-fast: false
Expand All @@ -17,11 +17,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
Expand All @@ -30,7 +31,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "11"
java-version: "17"

- name: Run Tests
uses: reactivecircus/android-emulator-runner@v2
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 6.0.4 (2024-06-05)
--------------------------
Send correct install referrer timestamps (#687)
Set serverAnonymisation more quickly (#689)

Version 6.0.3 (2024-04-18)
--------------------------
Add Subject config flag to avoid WindowManager bug (#657)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.3
6.0.4
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 = '6.0.3'
version = '6.0.4'
repositories {
google()
maven {
Expand Down
2 changes: 1 addition & 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=6.0.3
VERSION_NAME=6.0.4

POM_NAME=snowplow-android-tracker
POM_PACKAGING=aar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ import com.snowplowanalytics.snowplow.payload.SelfDescribingJson
import com.snowplowanalytics.snowplow.tracker.LogLevel

object Tracking {
/**
* Replace this with the URI of your Snowplow collector
* (e.g., Micro, Mini, or BDP).
*/
private const val collectorEndpoint = "placeholder"

@Composable
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 networkConfig = NetworkConfiguration(collectorEndpoint, HttpMethod.POST)
val trackerConfig = TrackerConfiguration("appID")
.logLevel(LogLevel.DEBUG)
.screenViewAutotracking(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ class Emitter(
var bufferOption: BufferOption = EmitterDefaults.bufferOption
/**
* Whether the buffer should send events instantly or after the buffer has reached
* its limit. By default, this is set to BufferOption Default.
*
* @param option Set the BufferOption enum to Instant to send events upon creation.
* its limit.
*/
set(option) {
if (!isRunning.get()) {
Expand Down Expand Up @@ -303,19 +301,8 @@ class Emitter(
*/
set(serverAnonymisation) {
field = serverAnonymisation
if (!isCustomNetworkConnection && builderFinished) {
networkConnection = emitTimeout?.let {
OkHttpNetworkConnectionBuilder(uri, context)
.method(httpMethod)
.tls(tlsVersions)
.emitTimeout(it)
.customPostPath(customPostPath)
.client(client)
.cookieJar(cookieJar)
.serverAnonymisation(serverAnonymisation)
.requestHeaders(requestHeaders)
.build()
}
if (!isCustomNetworkConnection && builderFinished && networkConnection is OkHttpNetworkConnection) {
(networkConnection as OkHttpNetworkConnection).serverAnonymisation = serverAnonymisation
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class InstallReferrerDetails(
"iglu:com.android.installreferrer.api/referrer_details/jsonschema/1-0-0",
mapOf(
"installReferrer" to installReferrer,
"referrerClickTimestamp" to if (referrerClickTimestamp > 0) { Util.getDateTimeFromTimestamp(referrerClickTimestamp) } else { null },
"installBeginTimestamp" to if (installBeginTimestamp > 0) { Util.getDateTimeFromTimestamp(installBeginTimestamp) } else { null },
"referrerClickTimestamp" to if (referrerClickTimestamp > 0) { Util.getDateTimeFromTimestamp(referrerClickTimestamp * 1000) } else { null },
"installBeginTimestamp" to if (installBeginTimestamp > 0) { Util.getDateTimeFromTimestamp(installBeginTimestamp * 1000) } else { null },
"googlePlayInstantParam" to googlePlayInstantParam,
)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ object Util {
return System.currentTimeMillis().toString()
}

/**
* Converts a timestamp in milliseconds to a DateTime.
*/
@JvmStatic
fun getDateTimeFromTimestamp(timestamp: Long): String {
val date = Date(timestamp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class OkHttpNetworkConnection private constructor(builder: OkHttpNetworkConnecti
override val httpMethod: HttpMethod
private val emitTimeout: Int
private val customPostPath: String?
private val serverAnonymisation: Boolean
var serverAnonymisation: Boolean
private val requestHeaders: Map<String, String>?
private var client: OkHttpClient? = null
private val uriBuilder: Uri.Builder
Expand Down

0 comments on commit fa694a5

Please sign in to comment.