bugfixes-swift

Error reporting for iOS, iPadOS, and Mac Catalyst 15+. Captures uncaught NSExceptions and receives crash and hang diagnostics through MetricKit. Up to 50 pending reports wait on disk.

Install

Add https://github.com/BugFixes/bugfixes-swift as a package dependency in Xcode and link its Bugfixes product, or add it to Package.swift:

.package(url: "https://github.com/BugFixes/bugfixes-swift", from: "0.1.0")

Create a mobile key

Create an agent in your project. From its public-key menu, choose Mobile key and allow your app's bundle identifier, such as com.example.app. Use the resulting bfm_ public key below. Never ship an agent secret in your app. An empty key disables reporting.

Start reporting

import SwiftUI
import Bugfixes

@main
struct MyApp: App {
    init() {
        Bugfixes.start(key: "bfm_your_public_key", environment: "production")
    }

    var body: some Scene {
        WindowGroup { Text("Hello") }
    }
}

Errors and logs

Bugfixes.report(NSError(domain: "Inventory", code: 1))
Bugfixes.log(.error, "Payment declined")

The default log threshold is error. Set level: .info in start() for routine logs. Release defaults to the bundle version and build; release: overrides it. Pending requests retry with the next report or app activation. MetricKit needs a real device and iOS controls diagnostic delivery, usually on the next launch. Native frames remain unsymbolicated without dSYM support.