Skip to content

Commit fcdc0a0

Browse files
committed
Remove method channels for captureEnvelope
1 parent 5fa2e5f commit fcdc0a0

File tree

2 files changed

+0
-48
lines changed

2 files changed

+0
-48
lines changed

flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ class SentryFlutterPlugin :
6363
) {
6464
when (call.method) {
6565
"initNativeSdk" -> initNativeSdk(call, result)
66-
"captureEnvelope" -> captureEnvelope(call, result)
6766
"loadImageList" -> loadImageList(call, result)
6867
"closeNativeSdk" -> closeNativeSdk(result)
6968
"fetchNativeAppStart" -> fetchNativeAppStart(result)
@@ -368,32 +367,6 @@ class SentryFlutterPlugin :
368367

369368
result.success("")
370369
}
371-
372-
private fun captureEnvelope(
373-
call: MethodCall,
374-
result: Result,
375-
) {
376-
if (!Sentry.isEnabled()) {
377-
result.error("1", "The Sentry Android SDK is disabled", null)
378-
return
379-
}
380-
val args = call.arguments() as List<Any>? ?: listOf()
381-
if (args.isNotEmpty()) {
382-
val event = args.first() as ByteArray?
383-
val containsUnhandledException = args[1] as Boolean
384-
if (event != null && event.isNotEmpty()) {
385-
val id = InternalSentrySdk.captureEnvelope(event, containsUnhandledException)
386-
if (id != null) {
387-
result.success("")
388-
} else {
389-
result.error("2", "Failed to capture envelope", null)
390-
}
391-
return
392-
}
393-
}
394-
result.error("3", "Envelope is null or empty", null)
395-
}
396-
397370
private fun loadImageList(
398371
call: MethodCall,
399372
result: Result,

flutter/ios/sentry_flutter/Sources/sentry_flutter/SentryFlutterPlugin.swift

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ public class SentryFlutterPlugin: NSObject, FlutterPlugin {
8181
case "closeNativeSdk":
8282
closeNativeSdk(call, result: result)
8383

84-
case "captureEnvelope":
85-
captureEnvelope(call, result: result)
86-
8784
case "fetchNativeAppStart":
8885
fetchNativeAppStart(result: result)
8986

@@ -412,24 +409,6 @@ public class SentryFlutterPlugin: NSObject, FlutterPlugin {
412409
return !name.isEmpty
413410
}
414411

415-
private func captureEnvelope(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
416-
guard let arguments = call.arguments as? [Any],
417-
!arguments.isEmpty,
418-
let data = (arguments.first as? FlutterStandardTypedData)?.data else {
419-
print("Envelope is null or empty!")
420-
result(FlutterError(code: "2", message: "Envelope is null or empty", details: nil))
421-
return
422-
}
423-
guard let envelope = PrivateSentrySDKOnly.envelope(with: data) else {
424-
print("Cannot parse the envelope data")
425-
result(FlutterError(code: "3", message: "Cannot parse the envelope data", details: nil))
426-
return
427-
}
428-
PrivateSentrySDKOnly.capture(envelope)
429-
result("")
430-
return
431-
}
432-
433412
struct TimeSpan {
434413
var startTimestampMsSinceEpoch: NSNumber
435414
var stopTimestampMsSinceEpoch: NSNumber

0 commit comments

Comments
 (0)