Skip to content

Commit ec702d5

Browse files
committed
Merge branch 'release/0.6.0'
2 parents b489be0 + 9311675 commit ec702d5

File tree

125 files changed

+1366
-229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+1366
-229
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ jobs:
66
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
flutter: ['3.0.0']
9+
flutter: ['3.19.0']
1010
steps:
11-
- uses: actions/checkout@v2
12-
- uses: subosito/flutter-action@v1
11+
- uses: actions/checkout@v4
12+
- uses: subosito/flutter-action@v2
1313
with:
1414
flutter-version: ${{ matrix.flutter }}
1515
channel: 'stable'
@@ -20,20 +20,20 @@ jobs:
2020
name: Analyze
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v2
24-
- uses: subosito/flutter-action@v1
23+
- uses: actions/checkout@v4
24+
- uses: subosito/flutter-action@v2
2525
with:
26-
flutter-version: '3.0.0'
26+
flutter-version: '3.19.0'
2727
channel: 'stable'
2828
- run: flutter pub get
2929
- run: flutter analyze
30-
- run: flutter format -n --set-exit-if-changed .
30+
- run: dart format --set-exit-if-changed .
3131

3232
build-android:
3333
name: Integration tests on Android
3434
runs-on: macos-latest
3535
steps:
36-
- uses: actions/checkout@v2
36+
- uses: actions/checkout@v4
3737
- uses: actions/setup-java@v1
3838
with:
3939
java-version: "11.x"
@@ -58,9 +58,9 @@ jobs:
5858
run: while ! nc -z '0.0.0.0' 9090; do sleep 1; done
5959

6060
# -- Integration tests --
61-
- uses: subosito/flutter-action@v1
61+
- uses: subosito/flutter-action@v2
6262
with:
63-
flutter-version: '3.0.0'
63+
flutter-version: '3.19.0'
6464
channel: 'stable'
6565

6666
- name: Run Flutter Driver tests
@@ -77,7 +77,7 @@ jobs:
7777
name: Integration tests on iOS
7878
runs-on: macos-latest
7979
steps:
80-
- uses: actions/checkout@v2
80+
- uses: actions/checkout@v4
8181

8282
# -- Micro --
8383
- name: Cache Micro
@@ -106,9 +106,9 @@ jobs:
106106
erase_before_boot: true
107107
shutdown_after_job: true
108108

109-
- uses: subosito/flutter-action@v1
109+
- uses: subosito/flutter-action@v2
110110
with:
111-
flutter-version: '3.0.0'
111+
flutter-version: '3.19.0'
112112
channel: 'stable'
113113

114114
- run: "flutter clean"
@@ -122,7 +122,7 @@ jobs:
122122
runs-on: ubuntu-latest
123123
steps:
124124

125-
- uses: actions/checkout@v2
125+
- uses: actions/checkout@v4
126126

127127
# -- Micro --
128128
- name: Cache Micro
@@ -144,9 +144,9 @@ jobs:
144144
run: while ! nc -z '0.0.0.0' 9090; do sleep 1; done
145145

146146
# -- Integration tests --
147-
- uses: subosito/flutter-action@v1
147+
- uses: subosito/flutter-action@v2
148148
with:
149-
flutter-version: '3.0.0'
149+
flutter-version: '3.19.0'
150150
channel: 'stable'
151151

152152
- run: chromedriver --port=4444 &

.github/workflows/publish.yml

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ name: Publish package to pub.dev and make a GitHub release
33
on:
44
push:
55
tags:
6-
- '*.*.*'
6+
- '[0-9]+.[0-9]+.[0-9]+*'
77

88
jobs:
99
test:
1010
name: Run unit tests
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
flutter: ['3.0.0']
14+
flutter: ['3.19.0']
1515
steps:
16-
- uses: actions/checkout@v2
17-
- uses: subosito/flutter-action@v1
16+
- uses: actions/checkout@v4
17+
- uses: subosito/flutter-action@v2
1818
with:
1919
flutter-version: ${{ matrix.flutter }}
2020
channel: 'stable'
@@ -28,7 +28,7 @@ jobs:
2828

2929
steps:
3030
- name: Checkout code
31-
uses: actions/checkout@v2
31+
uses: actions/checkout@v4
3232

3333
- name: Setup Node
3434
uses: actions/setup-node@v2
@@ -61,34 +61,37 @@ jobs:
6161
fi
6262
6363
publish_pubdev:
64-
needs: ["test", "version_check"]
6564
runs-on: ubuntu-latest
66-
container:
67-
image: google/dart:latest
65+
needs: ["test", "version_check"]
66+
permissions:
67+
id-token: write
6868
steps:
69-
- uses: actions/checkout@v1
70-
- name: Setup credentials
71-
run: |
72-
mkdir -p ~/.pub-cache
73-
cat <<EOF > ~/.pub-cache/credentials.json
74-
{
75-
"accessToken":"${{ secrets.ACCESS_TOKEN }}",
76-
"refreshToken":"${{ secrets.REFRESH_TOKEN }}",
77-
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
78-
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
79-
"expiration": 1643122520446
80-
}
81-
EOF
82-
- name: Publish package
83-
run: pub publish -f
69+
- uses: actions/checkout@v4
70+
71+
- name: Setup Dart
72+
uses: dart-lang/setup-dart@v1
73+
with:
74+
sdk: stable
75+
76+
- name: Setup Flutter
77+
uses: subosito/flutter-action@v2
78+
with:
79+
channel: 'stable'
80+
cache: true
81+
82+
- name: Check Flutter version
83+
run: flutter --version
84+
85+
- name: Publish to pub.dev
86+
run: flutter pub publish --force
8487

8588
release:
8689
needs: ["test", "publish_pubdev", "version_check"]
8790
runs-on: ubuntu-latest
8891

8992
steps:
9093
- name: Checkout code
91-
uses: actions/checkout@v2
94+
uses: actions/checkout@v4
9295

9396
- name: Release
9497
uses: softprops/[email protected]

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 0.6.0
2+
3+
* Upgrade mobile trackers to version 6.0
4+
* Add support for mobile screen engagement tracking including list item view and scroll changed events (#43)
5+
* Add configuration to override platform context properties in the mobile context including the IDFA identifiers (#44)
6+
* Update SDK constraint to <4.0.0 (#42)
7+
* Fix publish action (#38)
8+
* Remove deprecated setMockMethodCallHandler from tests (#41)
9+
* Move the repository to the snowplow Github organization (#29)
10+
* Update copyright headers
11+
112
# 0.5.0
213

314
* Add lifecycle autotracking config option (#39)

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ If you see an issue you would like to work on, please let us know in the issue!
2626
not doubling the amount of work.
2727

2828
If you don't know where to start contributing, you can look at
29-
[the issues labeled `good first issue`](https://github.com/snowplow-incubator/snowplow-flutter-tracker/labels/category%3Agood_first_issue).
29+
[the issues labeled `good first issue`](https://github.com/snowplow/snowplow-flutter-tracker/labels/category%3Agood_first_issue).
3030

3131
## Pull requests
3232

@@ -68,7 +68,7 @@ If your pull request is fairly chunky, there might be a non-trivial delay betwee
6868
### Contributor license agreement
6969

7070
We require outside contributors to sign a Contributor license agreement (or CLA) before we can merge their pull requests.
71-
You can find more information on the topic in [the dedicated wiki page](https://github.com/snowplow/snowplow/wiki/CLA).
71+
You can find more information on the topic in [the dedicated wiki page](https://docs.snowplow.io/docs/contributing/contributor-license-agreement/).
7272
The @snowplowcla bot will guide you through the process.
7373

7474
## Getting in touch

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
same "printed page" as the copyright notice for easier
188188
identification within third-party archives.
189189

190-
Copyright 2022 Snowplow Analytics Ltd.
190+
Copyright 2022-present Snowplow Analytics Ltd.
191191

192192
Licensed under the Apache License, Version 2.0 (the "License");
193193
you may not use this file except in compliance with the License.

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ It is build on top of Snowplow's native [iOS](https://github.com/snowplow/snowpl
3030
| Session context entity added to events ||||
3131
| Geo-location context entity ||||
3232
| Mobile platform context entity ||| |
33-
| Web page context entity | | ||
33+
| Web page context entity | | ||
3434
| Configurable GDPR context entity ||||
3535
| Lifecycle autotracking ||| |
36+
| Engagement tracking (activity tracking on Web, mobile screen engagement on mobile) ||||
3637

3738
## Quick Start
3839

@@ -48,7 +49,7 @@ This will add a line with the dependency like this to your `pubspec.yaml`:
4849

4950
```yml
5051
dependencies:
51-
snowplow_tracker: ^0.5.0
52+
snowplow_tracker: ^0.6.0
5253
```
5354
5455
Import the package into your Dart code:
@@ -61,7 +62,7 @@ import 'package:snowplow_tracker/snowplow_tracker.dart'
6162

6263
If using the tracker within a Flutter app for Web, you will also need to import the Snowplow JavaScript Tracker in your `index.html` file. Please load the JS tracker with the Snowplow tag as [described in the official documentation](https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/javascript-tracker/javascript-tracker-v3/tracker-setup/loading/). Do not change the global function name `snowplow` that is used to access the tracker – the Flutter APIs assume that it remains the default as shown in documentation.
6364

64-
Make sure to use JavaScript tracker version `3.5` or newer. You may also refer to the [example project](https://github.com/snowplow-incubator/snowplow-flutter-tracker/tree/main/example) in the Flutter tracker repository to see this in action.
65+
Make sure to use JavaScript tracker version `3.5` or newer. You may also refer to the [example project](https://github.com/snowplow/snowplow-flutter-tracker/tree/main/example) in the Flutter tracker repository to see this in action.
6566

6667
### Using the Tracker
6768

@@ -146,7 +147,7 @@ Assuming [Flutter SDK](https://docs.flutter.dev/get-started/install) is set up a
146147
#### Clone Repository
147148

148149
```bash
149-
git clone https://github.com/snowplow-incubator/snowplow-flutter-tracker.git
150+
git clone https://github.com/snowplow/snowplow-flutter-tracker.git
150151
```
151152

152153
## Example App
@@ -211,7 +212,7 @@ To run the integration tests on Web:
211212

212213
## Copyright and License
213214

214-
The Snowplow Flutter Tracker is copyright 2022 Snowplow Analytics Ltd.
215+
The Snowplow Flutter Tracker is copyright 2022-present Snowplow Analytics Ltd.
215216

216217
Licensed under the **[Apache License, Version 2.0][license]** (the "License");
217218
you may not use this software except in compliance with the License.
@@ -227,8 +228,8 @@ limitations under the License.
227228
[docs]: https://docs.snowplow.io/
228229
[flutter-docs]: https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/flutter-tracker/
229230

230-
[gh-actions]: https://github.com/snowplow-incubator/snowplow-flutter-tracker/actions/workflows/build.yml
231-
[gh-actions-image]: https://github.com/snowplow-incubator/snowplow-flutter-tracker/actions/workflows/build.yml/badge.svg
231+
[gh-actions]: https://github.com/snowplow/snowplow-flutter-tracker/actions/workflows/build.yml
232+
[gh-actions-image]: https://github.com/snowplow/snowplow-flutter-tracker/actions/workflows/build.yml/badge.svg
232233

233234
[license]: https://www.apache.org/licenses/LICENSE-2.0
234235
[license-image]: https://img.shields.io/badge/license-Apache--2-blue.svg?style=flat

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ android {
4747

4848
dependencies {
4949
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
50-
implementation "com.snowplowanalytics:snowplow-android-tracker:5.+"
50+
implementation "com.snowplowanalytics:snowplow-android-tracker:6.0.+"
5151
}

android/src/main/kotlin/com/snowplowanalytics/snowplow_tracker/SnowplowTrackerController.kt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022 Snowplow Analytics Ltd. All rights reserved.
1+
// Copyright (c) 2022-present Snowplow Analytics Ltd. All rights reserved.
22
//
33
// This program is licensed to you under the Apache License Version 2.0,
44
// and you may not use this file except in compliance with the Apache License Version 2.0.
@@ -71,6 +71,20 @@ object SnowplowTrackerController {
7171
trackerController?.track(screenView)
7272
}
7373

74+
fun trackScrollChanged(eventReader: EventMessageReader) {
75+
val trackerController = Snowplow.getTracker(eventReader.tracker)
76+
val scroll = eventReader.toScrollChangedWithContexts()
77+
78+
trackerController?.track(scroll)
79+
}
80+
81+
fun trackListItemView(eventReader: EventMessageReader) {
82+
val trackerController = Snowplow.getTracker(eventReader.tracker)
83+
val listItem = eventReader.toListItemViewWithContexts()
84+
85+
trackerController?.track(listItem)
86+
}
87+
7488
fun trackTiming(eventReader: EventMessageReader) {
7589
val trackerController = Snowplow.getTracker(eventReader.tracker)
7690
val timing = eventReader.toTimingWithContexts()

android/src/main/kotlin/com/snowplowanalytics/snowplow_tracker/SnowplowTrackerPlugin.kt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022 Snowplow Analytics Ltd. All rights reserved.
1+
// Copyright (c) 2022-present Snowplow Analytics Ltd. All rights reserved.
22
//
33
// This program is licensed to you under the Apache License Version 2.0,
44
// and you may not use this file except in compliance with the Apache License Version 2.0.
@@ -45,6 +45,8 @@ class SnowplowTrackerPlugin: FlutterPlugin, MethodCallHandler {
4545
"trackStructured" -> onTrackStructured(call, result)
4646
"trackSelfDescribing" -> onTrackSelfDescribing(call, result)
4747
"trackScreenView" -> onTrackScreenView(call, result)
48+
"trackScrollChanged" -> onTrackScrollChanged(call, result)
49+
"trackListItemView" -> onTrackListItemView(call, result)
4850
"trackTiming" -> onTrackTiming(call, result)
4951
"trackConsentGranted" -> onTrackConsentGranted(call, result)
5052
"trackConsentWithdrawn" -> onTrackConsentWithdrawn(call, result)
@@ -91,6 +93,20 @@ class SnowplowTrackerPlugin: FlutterPlugin, MethodCallHandler {
9193
result.success(null)
9294
}
9395

96+
private fun onTrackScrollChanged(call: MethodCall, result: MethodChannel.Result) {
97+
(call.arguments as? Map<String, Any>)?.let {
98+
SnowplowTrackerController.trackScrollChanged(EventMessageReader(it))
99+
}
100+
result.success(null)
101+
}
102+
103+
private fun onTrackListItemView(call: MethodCall, result: MethodChannel.Result) {
104+
(call.arguments as? Map<String, Any>)?.let {
105+
SnowplowTrackerController.trackListItemView(EventMessageReader(it))
106+
}
107+
result.success(null)
108+
}
109+
94110
private fun onTrackTiming(call: MethodCall, result: MethodChannel.Result) {
95111
(call.arguments as? Map<String, Any>)?.let {
96112
SnowplowTrackerController.trackTiming(EventMessageReader(it))

android/src/main/kotlin/com/snowplowanalytics/snowplow_tracker/TrackerVersion.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022 Snowplow Analytics Ltd. All rights reserved.
1+
// Copyright (c) 2022-present Snowplow Analytics Ltd. All rights reserved.
22
//
33
// This program is licensed to you under the Apache License Version 2.0,
44
// and you may not use this file except in compliance with the Apache License Version 2.0.
@@ -12,5 +12,5 @@
1212
package com.snowplowanalytics.snowplow_tracker
1313

1414
object TrackerVersion {
15-
val TRACKER_VERSION = "flutter-0.5.0"
15+
val TRACKER_VERSION = "flutter-0.6.0"
1616
}

0 commit comments

Comments
 (0)