Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dart/lib/src/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ String sdkName(bool isWeb) => isWeb ? _browserSdkName : _ioSdkName;
const String _ioSdkName = 'sentry.dart';

/// The SDK name for web projects reported to Sentry.io in the submitted events.
const String _browserSdkName = 'sentry.dart.browser';
const String _browserSdkName = '$_ioSdkName.browser';

/// The name of the SDK platform reported to Sentry.io in the submitted events.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import io.sentry.Sentry
import io.sentry.DateUtils
import io.sentry.android.core.ActivityFramesTracker
import io.sentry.android.core.AppStartState
import io.sentry.android.core.BuildConfig.VERSION_NAME
import io.sentry.android.core.LoadClass
import io.sentry.android.core.SentryAndroid
import io.sentry.android.core.SentryAndroidOptions
Expand Down Expand Up @@ -165,16 +166,18 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {

args.getIfNotNull<Boolean>("sendClientReports") { options.isSendClientReports = it }

args.getIfNotNull<Map<String, Any>>("sdk") { sdk ->
val name = sdk["name"] as? String
val version = sdk["version"] as? String
if (name != null && version != null) {
val sdkVersion = SdkVersion(name, version)
options.setSentryClientName("$name/$version")
options.setSdkVersion(sdkVersion)
}
val name = "sentry.java.android.flutter"

var sdkVersion = options.sdkVersion
if (sdkVersion == null) {
sdkVersion = SdkVersion(name, VERSION_NAME)
} else {
sdkVersion.name = name
}

options.sdkVersion = sdkVersion
options.sentryClientName = "$name/$VERSION_NAME"

options.setBeforeSend { event, _ ->
setEventOriginTag(event)
addPackages(event, options.sdkVersion)
Expand Down Expand Up @@ -476,10 +479,10 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
private fun addPackages(event: SentryEvent, sdk: SdkVersion?) {
event.sdk?.let {
if (it.name == flutterSdk) {
sdk?.packages?.forEach { sentryPackage ->
sdk?.packageSet?.forEach { sentryPackage ->
it.addPackage(sentryPackage.name, sentryPackage.version)
}
sdk?.integrations?.forEach { integration ->
sdk?.integrationSet?.forEach { integration ->
it.addIntegration(integration)
}
}
Expand Down
5 changes: 3 additions & 2 deletions flutter/example/macos/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 PBXAggregateTarget section */
Expand Down Expand Up @@ -209,7 +209,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
Expand Down Expand Up @@ -262,6 +262,7 @@
/* Begin PBXShellScriptBuildPhase section */
3399D490228B24CF009A79C7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
8 changes: 3 additions & 5 deletions flutter/ios/Classes/SentryFlutterPluginApple.swift
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,9 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
#endif
}

if let sdk = arguments["sdk"] as? [String: Any?],
let name = sdk["name"] as? String,
let version = sdk["version"] as? String {
PrivateSentrySDKOnly.setSdkName(name, andVersionString: version)
}
let name = "sentry.cocoa.flutter"
let version = PrivateSentrySDKOnly.getSdkVersionString()
PrivateSentrySDKOnly.setSdkName(name, andVersionString: version)

// note : for now, in sentry-cocoa, beforeSend is not called before captureEnvelope
options.beforeSend = { event in
Expand Down