diff --git a/CHANGELOG.md b/CHANGELOG.md index 8136018bd..2e6157c83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Bugsnag Notifiers on other platforms. * Add a breadcrumb when Bugsnag first starts with the message "Bugsnag loaded" [#445](https://github.com/bugsnag/bugsnag-cocoa/pull/445) +* Add a breadcrumb when network connectivity changes ## Bug fixes diff --git a/Source/BugsnagNotifier.m b/Source/BugsnagNotifier.m index fc0fffabe..292535b5c 100644 --- a/Source/BugsnagNotifier.m +++ b/Source/BugsnagNotifier.m @@ -532,6 +532,14 @@ - (void)setupConnectivityListener { __strong typeof(weakSelf) strongSelf = weakSelf; if (connected) [strongSelf flushPendingReports]; + + if (strongSelf.configuration.automaticallyCollectBreadcrumbs) { + [strongSelf addBreadcrumbWithBlock:^(BugsnagBreadcrumb *crumb) { + crumb.name = @"Connectivity change"; + crumb.type = BSGBreadcrumbTypeState; + crumb.metadata = @{ @"type" : connectionType }; + }]; + } }]; }