Skip to content

Commit

Permalink
Add BugsnagTelemetryType.usage (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdowell authored Oct 24, 2022
1 parent daf9df9 commit ec63666
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## TBD

- Added `BugsnagTelemetryType.usage` to allow sending of usage telemetry to be disabled.
[#176](https://github.com/bugsnag/bugsnag-flutter/pull/176)
- Update bugsnag-cocoa from v6.21.0 to [v6.24.0](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6240-2022-10-05)
- Update bugsnag-android from v5.25.0 to [v5.28.1](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5281-2022-10-19)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class EnumHelper {
dartBreadcrumbTypes.put("manual", BreadcrumbType.MANUAL);

dartTelemetry.put("internalErrors", Telemetry.INTERNAL_ERRORS);
dartTelemetry.put("usage", Telemetry.USAGE);
}

private EnumHelper() {
Expand Down
3 changes: 2 additions & 1 deletion packages/bugsnag_flutter/ios/Classes/BugsnagFlutterPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ - (void)start:(NSDictionary *)arguments {
NSArray *telemetry = arguments[@"telemetry"];
if ([telemetry isKindOfClass:[NSArray class]]) {
BSGTelemetryOptions value =
([telemetry containsObject:@"internalErrors"] ? BSGTelemetryInternalErrors : 0);
([telemetry containsObject:@"internalErrors"] ? BSGTelemetryInternalErrors : 0) |
([telemetry containsObject:@"usage"] ? BSGTelemetryUsage : 0) ;
configuration.telemetry = value;
}

Expand Down
3 changes: 3 additions & 0 deletions packages/bugsnag_flutter/lib/src/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,7 @@ enum BugsnagEnabledBreadcrumbType {
enum BugsnagTelemetryType {
/// Errors within the Bugsnag SDK.
internalErrors,

/// Information about how Bugsnag has been configured.
usage,
}
2 changes: 1 addition & 1 deletion packages/bugsnag_flutter/test/bugsnag_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void main() {

expect(
channel['start'][0]['telemetry'],
equals(const ['internalErrors']),
equals(const ['internalErrors', 'usage']),
);
});

Expand Down

0 comments on commit ec63666

Please sign in to comment.