Skip to content

Commit

Permalink
default library version to unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
Mercy811 committed Mar 6, 2024
1 parent 596613d commit 4eb9b6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ class AmplitudeFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
amplitude = Amplitude(configuration)

// Set library
amplitude.add(FlutterLibraryPlugin(call.argument<String>("library")!!))
amplitude.add(
FlutterLibraryPlugin(
call.argument<String>("library") ?: "amplitude-flutter/unknown"
)
)

call.argument<String>("logLevel")?.let {
amplitude.logger.logMode = Logger.LogMode.valueOf(it.uppercase())
Expand Down
10 changes: 5 additions & 5 deletions ios/Classes/SwiftAmplitudeFlutterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import AmplitudeSwift
}

// Set library
guard let library = args["library"] as? String else {
amplitude?.logger?.warn(message: "Failed to set library.")
return
}
amplitude?.add(plugin: FlutterLibraryPlugin(library: library))
amplitude?.add(
plugin: FlutterLibraryPlugin(
library: args["library"] as? String ?? "amplitude-flutter/unknown"
)
)

amplitude?.logger?.debug(message: "Amplitude has been successfully initialized.")

Expand Down

0 comments on commit 4eb9b6f

Please sign in to comment.