Skip to content

Commit

Permalink
Persist default version information in BugsnagConfiguration so that i…
Browse files Browse the repository at this point in the history
…t gets put into events when users don't manually set version info.
  • Loading branch information
kstenerud committed Oct 26, 2020
1 parent b5120c5 commit ec8dbf9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Bugsnag/Configuration/BugsnagConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ - (instancetype _Nonnull)initWithApiKey:(NSString *_Nonnull)apiKey
_metadata = [[BugsnagMetadata alloc] init];
_config = [[BugsnagMetadata alloc] init];
_bundleVersion = NSBundle.mainBundle.infoDictionary[@"CFBundleVersion"];
_appVersion = NSBundle.mainBundle.infoDictionary[@"CFBundleShortVersionString"];
_endpoints = [BugsnagEndpointConfiguration new];
_sessionURL = [NSURL URLWithString:@"https://sessions.bugsnag.com"];
_autoDetectErrors = YES;
Expand Down Expand Up @@ -216,6 +217,11 @@ - (instancetype _Nonnull)initWithApiKey:(NSString *_Nonnull)apiKey
#elif BSG_PLATFORM_OSX
_appType = @"macOS";
#endif

// Quick fix to get version info working, but the rest of the default values are still not persisted.
[self setAppVersion:_appVersion];
[self setBundleVersion:_bundleVersion];

return self;
}

Expand Down

0 comments on commit ec8dbf9

Please sign in to comment.