From 4bacaaa90a0e91ae1c08d32600d5e8b07b1b259b Mon Sep 17 00:00:00 2001 From: "izaaz.yunus" Date: Thu, 20 Jun 2024 20:57:49 -0700 Subject: [PATCH] patch: Adding underlying library version to library field --- .../amplitude/amplitude_flutter/FlutterLibraryPlugin.kt | 6 +++++- ios/Classes/FlutterLibraryPlugin.swift | 7 +++++-- ios/amplitude_flutter.podspec | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/android/src/main/kotlin/com/amplitude/amplitude_flutter/FlutterLibraryPlugin.kt b/android/src/main/kotlin/com/amplitude/amplitude_flutter/FlutterLibraryPlugin.kt index c5b853e..315a682 100644 --- a/android/src/main/kotlin/com/amplitude/amplitude_flutter/FlutterLibraryPlugin.kt +++ b/android/src/main/kotlin/com/amplitude/amplitude_flutter/FlutterLibraryPlugin.kt @@ -9,7 +9,11 @@ class FlutterLibraryPlugin(val library: String): Plugin { override lateinit var amplitude: Amplitude override fun execute(event: BaseEvent): BaseEvent? { - event.library = library + if (event.library == null) { + event.library = library + } else { + event.library = "$library_${event.library}" + } return super.execute(event) } } diff --git a/ios/Classes/FlutterLibraryPlugin.swift b/ios/Classes/FlutterLibraryPlugin.swift index d505751..d548c1c 100644 --- a/ios/Classes/FlutterLibraryPlugin.swift +++ b/ios/Classes/FlutterLibraryPlugin.swift @@ -9,8 +9,11 @@ class FlutterLibraryPlugin: BeforePlugin { } override func execute(event: BaseEvent) -> BaseEvent? { - event.library = library - + if let eventLibrary = event.library { + event.library = "\(library)_\(eventLibrary)" + } else { + event.library = library + } return event } } diff --git a/ios/amplitude_flutter.podspec b/ios/amplitude_flutter.podspec index 6703514..d73a355 100644 --- a/ios/amplitude_flutter.podspec +++ b/ios/amplitude_flutter.podspec @@ -12,7 +12,7 @@ Pod::Spec.new do |s| s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' - s.dependency 'AmplitudeSwift', '~> 1.4.4' # enable default app lifecycle events + s.dependency 'AmplitudeSwift', '~> 1.6' # enable default app lifecycle events s.ios.deployment_target = '13.0' end