Skip to content

Commit

Permalink
fix: Adding underlying library version to library field (#192)
Browse files Browse the repository at this point in the history
We currently only track flutter's SDK version. This change will now track flutter SDK version along with the underlying iOS/Android SDK version that is being used
  • Loading branch information
izaaz authored Jun 24, 2024
1 parent 963f48d commit 9afeaa1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
7 changes: 5 additions & 2 deletions ios/Classes/FlutterLibraryPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
2 changes: 1 addition & 1 deletion ios/amplitude_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'

s.ios.deployment_target = '13.0'
end
Expand Down

0 comments on commit 9afeaa1

Please sign in to comment.