Skip to content

Commit

Permalink
Upgrade underlying iOS and Android trackers to version 5 (close #36)
Browse files Browse the repository at this point in the history
  • Loading branch information
matus-tomlein committed Jul 12, 2023
1 parent 88e445a commit 15d8d94
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 23 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
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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()
Expand All @@ -25,7 +25,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 31
compileSdkVersion 33

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -47,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.+"
}
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
2 changes: 1 addition & 1 deletion 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 Down
12 changes: 6 additions & 6 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ PODS:
- Flutter
- snowplow_tracker (0.3.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: f3d9416ea1d05205fc242d4786b98d207337a6dc
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 ios/Classes/SnowplowTrackerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import SnowplowTracker

class SnowplowTrackerController {
static func createTracker(_ message: CreateTrackerMessageReader, arguments: [String: Any]) {
var controllers: [Configuration] = []
var controllers: [ConfigurationProtocol] = []

if let trackerConfig = message.trackerConfig {
controllers.append(trackerConfig.toConfiguration())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,26 @@ struct TrackerConfigurationReader: Decodable {
let applicationContext: Bool?

var devicePlatformType: DevicePlatform? {
if let devicePlatform = self.devicePlatform { return SPStringToDevicePlatform(devicePlatform) }
if let devicePlatform = self.devicePlatform {
switch devicePlatform {
case "web":
return DevicePlatform.web
case "srv":
return DevicePlatform.serverSideApp
case "pc":
return DevicePlatform.desktop
case "app":
return DevicePlatform.general
case "tv":
return DevicePlatform.connectedTV
case "cnsl":
return DevicePlatform.gameConsole
case "iot":
return DevicePlatform.internetOfThings
default:
return DevicePlatform.mobile
}
}
return nil
}
}
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/readers/events/ConsentGrantedReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension ConsentGrantedReader {
if let name = self.name { event.name(name) }
if let description = self.documentDescription { event.documentDescription(description) }
if let documents = self.consentDocuments {
let jsons = documents.map { $0.toConsentDocument().getPayload() }
let jsons = documents.map { $0.toConsentDocument().payload }
event.documents(jsons)
}
return event
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/readers/events/ConsentWithdrawnReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extension ConsentWithdrawnReader {
if let name = self.name { event.name(name) }
if let description = self.documentDescription { event.documentDescription(description) }
if let documents = self.consentDocuments {
let jsons = documents.map { $0.toConsentDocument().getPayload() }
let jsons = documents.map { $0.toConsentDocument().payload }
event.documents(jsons)
}
return event
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/readers/events/TimingReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct TimingReader: Decodable {

extension TimingReader {
func toTiming() -> Timing {
let event = Timing(category: category, variable: variable, timing: NSNumber(value: timing))
let event = Timing(category: category, variable: variable, timing: timing)
if let label = self.label { event.label(label) }
return event
}
Expand Down
4 changes: 2 additions & 2 deletions ios/Classes/readers/messages/EventMessageReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ extension EventMessageReader {
func addContextsToEvent(_ event: Event, arguments: [String: Any]) {
if let readers = self.contexts,
let readersArgs = arguments["contexts"] as? [[String: Any]] {
let contexts = zip(readers, readersArgs).map { (reader, readerArgs) in
let entities = zip(readers, readersArgs).map { (reader, readerArgs) in
reader.toSelfDescribingJson(arguments: readerArgs)
}.compactMap { $0 }
event.contexts(NSMutableArray(array: contexts))
event.entities(entities)
}
}
}
4 changes: 2 additions & 2 deletions ios/snowplow_tracker.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ A package for tracking Snowplow events in Flutter apps.
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.dependency 'SnowplowTracker', '~> 4.0'
s.platform = :ios, '9.0'
s.dependency 'SnowplowTracker', '~> 5.4'
s.platform = :ios, '11.0'

# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
Expand Down

0 comments on commit 15d8d94

Please sign in to comment.