Integrating Bugsnag for mobile app error tracking
Bugsnag occupies niche between Crashlytics and Sentry: richer error grouping than Firebase, but without Sentry's performance-tracing overhead. Main strength — intelligent error grouping: Bugsnag groups similar crashes by stack trace intelligently, not creating thousands of separate issues from one error with different memory addresses. In projects with large audiences, this dramatically simplifies prioritization.
iOS connection
// Package.swift or SPM in Xcode
// https://github.com/bugsnag/bugsnag-cocoa
import Bugsnag
@main
struct MyApp: App {
init() {
let config = BugsnagConfiguration.loadConfig()
config.apiKey = "YOUR_API_KEY"
config.releaseStage = Bundle.main.infoDictionary?["ReleaseStage"] as? String ?? "production"
config.notifyReleaseStages = ["staging", "production"]
Bugsnag.start(with: config)
}
}
notifyReleaseStages — one of first parameters to configure. Without it, debug builds clutter dashboard with development events.
Android connection
implementation("com.bugsnag:bugsnag-android:5.+")
In AndroidManifest.xml:
<meta-data android:name="com.bugsnag.android.API_KEY" android:value="YOUR_API_KEY"/>
SDK auto-initializes on Application startup. For custom configuration:
val config = Configuration.load(this).apply {
releaseStage = BuildConfig.RELEASE_STAGE
enabledReleaseStages = setOf("staging", "production")
maxBreadcrumbs = 50
}
Bugsnag.start(this, config)
Context enrichment
Bugsnag works especially well with metadata — structured by tabs in each bug report:
Bugsnag.addOnSendError { event in
event.addMetadata([
"user_id": userId,
"subscription": "premium",
"cart_items": cartCount
], section: "app_state")
event.setUser(userId, withEmail: email, andName: name)
return true
}
app_state section appears as separate tab in Bugsnag interface. Quickly see app state at moment of error without log parsing.
Severity and priority management
// Explicitly mark error as non-critical
Bugsnag.notifyError(NetworkError.timeout) { event in
event.severity = .warning
event.context = "profile_image_load"
return true
}
Severity affects dashboard sorting and alerts. error — goes to Slack/PagerDuty immediately, warning — aggregated into digest.
Bugsnag vs Crashlytics: when to choose Bugsnag
| Criterion | Bugsnag | Crashlytics |
|---|---|---|
| Error grouping | Intelligent, configurable | Basic by stack trace |
| Metadata | Tabs with arbitrary structure | Key-value, flat |
| Free plan | Limited (up to 7500 events/month) | Free in Firebase |
| Self-hosted | No | No |
| Integrations | Jira, PagerDuty, Slack, GitHub | Firebase Console, Email |
Bugsnag justified where team spends time sorting duplicates in Crashlytics. Good grouping pays for itself at 10k+ DAU volume.
What's included in the work
- SDK connection (iOS SPM / Android Gradle / Flutter / React Native)
- Release stages configuration and dev build filtering
- Metadata configuration through
addOnSendError - Breadcrumbs and custom context setup
- Jira or Slack integration for alerts
- dSYM (iOS) and ProGuard mapping (Android) upload
Timeline
Basic integration: 0.5–1 day. Full setup with metadata and integrations: 1–2 days. Cost calculated individually.







