From 969dfaa8da8520fb1efaa06812d717030b346cfe Mon Sep 17 00:00:00 2001 From: delisa fuller Date: Thu, 12 Jun 2025 17:01:55 +0100 Subject: [PATCH 1/2] feat(ios): add fatal issue reporting init to objc --- platform/swift/source/LoggerObjc.swift | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/platform/swift/source/LoggerObjc.swift b/platform/swift/source/LoggerObjc.swift index 5c7f92e08..7904a465b 100644 --- a/platform/swift/source/LoggerObjc.swift +++ b/platform/swift/source/LoggerObjc.swift @@ -7,6 +7,12 @@ import Foundation +@objc(CAPIssueReporterType) +public enum IssueReporterTypeObjc: Int8 { + case builtIn + case customConfig +} + // Make this class not available to Swift code. It should be used by Objective-c code only. @available(swift, obsoleted: 1.0) @objc(CAPLogger) @@ -48,6 +54,20 @@ public final class LoggerObjc: NSObject { } } + /// Initializes the issue reporting mechanism. Must be called prior to `Logger.start()` + /// This API is experimental and subject to change + /// + /// - parameter type: mechanism for crash detection + @objc + public static func initFatalIssueReporting(_ type: IssueReporterTypeObjc) { + switch type { + case .builtIn: + Capture.Logger.initFatalIssueReporting(.builtIn) + case .customConfig: + Capture.Logger.initFatalIssueReporting(.customConfig) + } + } + /// Defines the initialization of a new session within the current configured logger. /// If no logger is configured, this is a no-op. @objc From 3c577eb312302078d3d12fd0c51bb6f5bf113211 Mon Sep 17 00:00:00 2001 From: delisa fuller Date: Thu, 12 Jun 2025 19:10:32 +0100 Subject: [PATCH 2/2] feat(ios): add default type for fatal reporting to objc --- platform/swift/source/LoggerObjc.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/swift/source/LoggerObjc.swift b/platform/swift/source/LoggerObjc.swift index 7904a465b..8b6194f63 100644 --- a/platform/swift/source/LoggerObjc.swift +++ b/platform/swift/source/LoggerObjc.swift @@ -54,12 +54,19 @@ public final class LoggerObjc: NSObject { } } + /// Initializes the issue reporting mechanism. Must be called prior to `Logger.start()` + /// This API is experimental and subject to change + @objc + public static func initFatalIssueReporting() { + Capture.Logger.initFatalIssueReporting(.builtIn) + } + /// Initializes the issue reporting mechanism. Must be called prior to `Logger.start()` /// This API is experimental and subject to change /// /// - parameter type: mechanism for crash detection @objc - public static func initFatalIssueReporting(_ type: IssueReporterTypeObjc) { + public static func initFatalIssueReporting(withType type: IssueReporterTypeObjc) { switch type { case .builtIn: Capture.Logger.initFatalIssueReporting(.builtIn)