Skip to content

Commit

Permalink
Merge branch 'release/0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
matus-tomlein committed Jul 13, 2023
2 parents 9a28636 + aec4fd3 commit 11965f8
Show file tree
Hide file tree
Showing 33 changed files with 232 additions and 121 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Run Flutter Driver tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 30
api-level: 31
target: default
arch: x86_64
profile: Nexus 6
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"request": "launch",
"type": "dart",
"args":[
"--dart-define=ENDPOINT=http://192.168.100.127:9090"
"--dart-define=ENDPOINT=http://192.168.100.2:9090"
]
}
]
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# 0.4.0

* Add configuration for setting custom HTTP headers for requests to the collector (#34)
* Upgrade underlying iOS and Android trackers to version 5 (#36)
* Remove deprecated kotlin-android-extensions plugin in example app (#35)
* Upgrade JavaScript tracker in the example app to version 3.13

# 0.3.0

* Enable screen and application context on mobile (#27)
* Add anonymous tracking features (#16)

# 0.2.0

* Configure custom POST path (#15)
* Upgrade underlying mobile native trackers to version 4 (#17)
* Fix schema link in documentation for ScreenView (#12)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ This will add a line with the dependency like this to your `pubspec.yaml`:

```yml
dependencies:
snowplow_tracker: ^0.3.0
snowplow_tracker: ^0.4.0
```

Import the package into your Dart code:
Expand Down
8 changes: 3 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ group 'com.snowplowanalytics.snowplow_tracker'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.8.0'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -24,10 +23,9 @@ rootProject.allprojects {

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 31
compileSdkVersion 33

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -49,5 +47,5 @@ android {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.snowplowanalytics:snowplow-android-tracker:4.+"
implementation "com.snowplowanalytics:snowplow-android-tracker:5.+"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
package com.snowplowanalytics.snowplow_tracker

object TrackerVersion {
val TRACKER_VERSION = "flutter-0.3.0"
val TRACKER_VERSION = "flutter-0.4.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class NetworkConfigurationReader(values: Map<String, Any>) {
val endpoint: String by values
val method: String? by valuesDefault
val customPostPath: String? by valuesDefault
val requestHeaders: Map<String, String>? by valuesDefault

fun toConfiguration(): NetworkConfiguration {
val networkConfig: NetworkConfiguration = if (method != null) {
Expand All @@ -31,6 +32,7 @@ class NetworkConfigurationReader(values: Map<String, Any>) {
NetworkConfiguration(endpoint)
}
customPostPath?.let { networkConfig.customPostPath(it) }
requestHeaders?.let { networkConfig.requestHeaders(it) }
return networkConfig
}
}
2 changes: 1 addition & 1 deletion doc/01-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This will add a line with the dependency like to your pubspec.yaml:

```yml
dependencies:
snowplow_tracker: ^0.3.0
snowplow_tracker: ^0.4.0
```

Import the package into your Dart code:
Expand Down
1 change: 1 addition & 0 deletions doc/02-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The only required attributes of the `Snowplow.createTracker` method are `namespa
| `endpoint` | `String` | URI for the Snowplow collector endpoint. |
| `method` | `Method?` | HTTP method to use: `Method.get` or `Method.post` (`Method.post` is default). |
| `customPostPath` | `String?` | Custom POST path. |
| `requestHeaders` | `Map<String, String>?` | Map of custom HTTP headers to add to requests to the collector. |
| `trackerConfig` | `TrackerConfiguration?` | Configuration of the tracker and the core tracker properties. |
| `gdprConfig` | `GdprConfiguration?` | Determines the GDPR context that will be attached to all events sent by the tracker. |
| `subjectConfig` | `SubjectConfiguration?` | Subject information about tracked user and device that is added to events. |
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 33

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
4 changes: 2 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.8.0'
repositories {
google()
mavenCentral()
Expand All @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
17 changes: 17 additions & 0 deletions example/integration_test/configuration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,21 @@ void main() {
return true;
});
});

testWidgets("sets custom request headers", (WidgetTester tester) async {
SnowplowTracker tracker = await Snowplow.createTracker(
namespace: 'custom-headers',
endpoint: SnowplowTests.microEndpoint,
requestHeaders: {'Warning': 'works'});

await tracker
.track(const Structured(category: 'category', action: 'action'));

expect(
await SnowplowTests.checkMicroGood((events) =>
(events.length == 1) &&
(events[0]['rawEvent']['context']['headers']
.contains('Warning: works'))),
isTrue);
});
}
14 changes: 7 additions & 7 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ PODS:
- FMDB/standard (2.7.5)
- integration_test (0.0.1):
- Flutter
- snowplow_tracker (0.3.0):
- snowplow_tracker (0.4.0):
- Flutter
- SnowplowTracker (~> 4.0)
- SnowplowTracker (4.0.0):
- SnowplowTracker (~> 5.4)
- SnowplowTracker (5.4.0):
- FMDB (~> 2.7)

DEPENDENCIES:
Expand All @@ -32,10 +32,10 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
integration_test: a1e7d09bd98eca2fc37aefd79d4f41ad37bdbbe5
snowplow_tracker: 7e24aa9029c152d9e97f76578c83d3704c1f103b
SnowplowTracker: 2ddc6db70af5415a87ac279f044d27d140b3a2b8
integration_test: 13825b8a9334a850581300559b8839134b124670
snowplow_tracker: 022a7e65a05a6f6043043d58d8df870b379efe5d
SnowplowTracker: a7fa5ae461955637f773a51c941635f39a5b0747

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3

COCOAPODS: 1.11.3
COCOAPODS: 1.12.0
5 changes: 4 additions & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -199,10 +199,12 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand Down Expand Up @@ -230,6 +232,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down
2 changes: 2 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@
<true/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/lib/overview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This will add a line with the dependency like this to your `pubspec.yaml`:
```yml
dependencies:
snowplow_tracker: ^0.3.0
snowplow_tracker: ^0.4.0
```
Import the package into your Dart code:
Expand Down
Loading

0 comments on commit 11965f8

Please sign in to comment.