Skip to content

Commit

Permalink
feat: Add a breadcrumb when connectivity changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kattrali committed Feb 7, 2020
1 parent ea18c69 commit 597e79a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions Source/BugsnagNotifier.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}];
}
}];
}

Expand Down

0 comments on commit 597e79a

Please sign in to comment.