From 9f866561bf132a8ee13dc87d72daedb639a5f527 Mon Sep 17 00:00:00 2001 From: Robin Macharg Date: Thu, 5 Mar 2020 16:13:31 +0000 Subject: [PATCH 1/4] (Feat)Rename BugsnagNotifier class to BugsnagClient --- CHANGELOG.md | 3 + Source/Bugsnag.m | 60 +++++++++---------- Source/{BugsnagNotifier.h => BugsnagClient.h} | 2 +- Source/{BugsnagNotifier.m => BugsnagClient.m} | 14 ++--- Source/BugsnagConfiguration.h | 2 +- Source/BugsnagConfiguration.m | 8 +-- Source/BugsnagErrorReportApiClient.m | 2 +- Source/BugsnagKSCrashSysInfoParser.m | 14 ++--- Source/BugsnagSessionTrackingPayload.m | 6 +- Source/BugsnagSink.m | 8 +-- Tests/BugsnagBaseUnitTest.m | 2 +- iOS/Bugsnag.xcodeproj/project.pbxproj | 24 ++++---- 12 files changed, 74 insertions(+), 71 deletions(-) rename Source/{BugsnagNotifier.h => BugsnagClient.h} (98%) rename Source/{BugsnagNotifier.m => BugsnagClient.m} (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed8c76ad5..54b7401a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ Bugsnag Notifiers on other platforms. ## Enhancements +* `BugsnagNotifier` is now `BugsnagClient`. + [#480](https://github.com/bugsnag/bugsnag-cocoa/pull/480) + * Add a breadcrumb when Bugsnag first starts with the message "Bugsnag loaded" [#445](https://github.com/bugsnag/bugsnag-cocoa/pull/445) diff --git a/Source/Bugsnag.m b/Source/Bugsnag.m index 252c638a2..4666963c9 100644 --- a/Source/Bugsnag.m +++ b/Source/Bugsnag.m @@ -27,15 +27,15 @@ #import "Bugsnag.h" #import "BSG_KSCrash.h" #import "BugsnagLogger.h" -#import "BugsnagNotifier.h" +#import "BugsnagClient.h" #import "BugsnagKeys.h" #import "BugsnagPlugin.h" -static BugsnagNotifier *bsg_g_bugsnag_notifier = NULL; +static BugsnagClient *bsg_g_bugsnag_client = NULL; static NSMutableArray > *registeredPlugins; @interface Bugsnag () -+ (BugsnagNotifier *)notifier; ++ (BugsnagClient *)client; + (BOOL)bugsnagStarted; + (void)registerPlugin:(id)plugin; @end @@ -54,16 +54,16 @@ + (void)startBugsnagWithApiKey:(NSString *)apiKey { + (void)startBugsnagWithConfiguration:(BugsnagConfiguration *)configuration { @synchronized(self) { - bsg_g_bugsnag_notifier = - [[BugsnagNotifier alloc] initWithConfiguration:configuration]; + bsg_g_bugsnag_client = + [[BugsnagClient alloc] initWithConfiguration:configuration]; [self startPlugins]; - [bsg_g_bugsnag_notifier start]; + [bsg_g_bugsnag_client start]; } } + (BugsnagConfiguration *)configuration { if ([self bugsnagStarted]) { - return self.notifier.configuration; + return self.client.configuration; } return nil; } @@ -72,8 +72,8 @@ + (BugsnagConfiguration *)instance { return [self configuration]; } -+ (BugsnagNotifier *)notifier { - return bsg_g_bugsnag_notifier; ++ (BugsnagClient *)client { + return bsg_g_bugsnag_client; } + (void)registerPlugin:(id)plugin { @@ -93,14 +93,14 @@ + (void)startPlugins { + (BOOL)appDidCrashLastLaunch { if ([self bugsnagStarted]) { - return [self.notifier appCrashedLastLaunch]; + return [self.client appCrashedLastLaunch]; } return NO; } + (void)notify:(NSException *)exception { if ([self bugsnagStarted]) { - [self.notifier notifyException:exception + [self.client notifyException:exception block:^(BugsnagEvent *_Nonnull report) { report.depth += 2; }]; @@ -109,7 +109,7 @@ + (void)notify:(NSException *)exception { + (void)notify:(NSException *)exception block:(BugsnagOnErrorBlock)block { if ([self bugsnagStarted]) { - [[self notifier] notifyException:exception + [[self client] notifyException:exception block:^(BugsnagEvent *_Nonnull report) { report.depth += 2; @@ -122,7 +122,7 @@ + (void)notify:(NSException *)exception block:(BugsnagOnErrorBlock)block { + (void)notifyError:(NSError *)error { if ([self bugsnagStarted]) { - [self.notifier notifyError:error + [self.client notifyError:error block:^(BugsnagEvent *_Nonnull report) { report.depth += 2; }]; @@ -131,7 +131,7 @@ + (void)notifyError:(NSError *)error { + (void)notifyError:(NSError *)error block:(BugsnagOnErrorBlock)block { if ([self bugsnagStarted]) { - [[self notifier] notifyError:error + [[self client] notifyError:error block:^(BugsnagEvent *_Nonnull report) { report.depth += 2; @@ -144,12 +144,12 @@ + (void)notifyError:(NSError *)error block:(BugsnagOnErrorBlock)block { + (void)notify:(NSException *)exception withData:(NSDictionary *)metadata { if ([self bugsnagStarted]) { - [[self notifier] + [[self client] notifyException:exception block:^(BugsnagEvent *_Nonnull report) { report.depth += 2; report.metadata = [metadata - BSG_mergedInto:[self.notifier.configuration + BSG_mergedInto:[self.client.configuration .metadata toDictionary]]; }]; } @@ -159,13 +159,13 @@ + (void)notify:(NSException *)exception withData:(NSDictionary *)metadata atSeverity:(NSString *)severity { if ([self bugsnagStarted]) { - [[self notifier] + [[self client] notifyException:exception atSeverity:BSGParseSeverity(severity) block:^(BugsnagEvent *_Nonnull report) { report.depth += 2; report.metadata = [metadata - BSG_mergedInto:[self.notifier.configuration + BSG_mergedInto:[self.client.configuration .metadata toDictionary]]; report.severity = BSGParseSeverity(severity); }]; @@ -176,7 +176,7 @@ + (void)internalClientNotify:(NSException *_Nonnull)exception withData:(NSDictionary *_Nullable)metadata block:(BugsnagOnErrorBlock _Nullable)block { if ([self bugsnagStarted]) { - [self.notifier internalClientNotify:exception + [self.client internalClientNotify:exception withData:metadata block:block]; } @@ -190,7 +190,7 @@ + (void)addMetadataToSection:(NSString *_Nonnull)section key:(NSString *_Nonnull)key value:(id _Nullable)value { if ([self bugsnagStarted]) { - [self.notifier.configuration.metadata addAttribute:key + [self.client.configuration.metadata addAttribute:key withValue:value toTabWithName:section]; } @@ -198,12 +198,12 @@ + (void)addMetadataToSection:(NSString *_Nonnull)section + (void)clearMetadataInSection:(NSString *)section { if ([self bugsnagStarted]) { - [self.notifier.configuration.metadata clearMetadataInSection:section]; + [self.client.configuration.metadata clearMetadataInSection:section]; } } + (BOOL)bugsnagStarted { - if (!self.notifier.started) { + if (!self.client.started) { bsg_log_err(@"Ensure you have started Bugsnag with startWithApiKey: " @"before calling any other Bugsnag functions."); @@ -223,44 +223,44 @@ + (void)leaveBreadcrumbWithMessage:(NSString *)message { + (void)leaveBreadcrumbWithBlock: (void (^_Nonnull)(BugsnagBreadcrumb *_Nonnull))block { if ([self bugsnagStarted]) { - [self.notifier addBreadcrumbWithBlock:block]; + [self.client addBreadcrumbWithBlock:block]; } } + (void)leaveBreadcrumbForNotificationName: (NSString *_Nonnull)notificationName { if ([self bugsnagStarted]) { - [self.notifier crumbleNotification:notificationName]; + [self.client crumbleNotification:notificationName]; } } + (void)setBreadcrumbCapacity:(NSUInteger)capacity { if ([self bugsnagStarted]) { - [self.notifier.configuration setMaxBreadcrumbs:capacity]; + [self.client.configuration setMaxBreadcrumbs:capacity]; } } + (void)clearBreadcrumbs { if ([self bugsnagStarted]) { - [self.notifier clearBreadcrumbs]; + [self.client clearBreadcrumbs]; } } + (void)startSession { if ([self bugsnagStarted]) { - [self.notifier startSession]; + [self.client startSession]; } } + (void)pauseSession { if ([self bugsnagStarted]) { - [self.notifier pauseSession]; + [self.client pauseSession]; } } + (BOOL)resumeSession { if ([self bugsnagStarted]) { - return [self.notifier resumeSession]; + return [self.client resumeSession]; } else { return false; } @@ -280,7 +280,7 @@ + (void)clearMetadataInSection:(NSString *_Nonnull)sectionName withKey:(NSString *_Nonnull)key { if ([self bugsnagStarted]) { - [self.notifier.configuration.metadata clearMetadataInSection:sectionName + [self.client.configuration.metadata clearMetadataInSection:sectionName key:key]; } } diff --git a/Source/BugsnagNotifier.h b/Source/BugsnagClient.h similarity index 98% rename from Source/BugsnagNotifier.h rename to Source/BugsnagClient.h index f6a3dc7e2..f76abdfe6 100644 --- a/Source/BugsnagNotifier.h +++ b/Source/BugsnagClient.h @@ -31,7 +31,7 @@ @class BugsnagSessionTracker; -@interface BugsnagNotifier : NSObject +@interface BugsnagClient : NSObject @property(nonatomic, readwrite, retain) BugsnagConfiguration *_Nullable configuration; diff --git a/Source/BugsnagNotifier.m b/Source/BugsnagClient.m similarity index 99% rename from Source/BugsnagNotifier.m rename to Source/BugsnagClient.m index 4fa93352b..08d9929e4 100644 --- a/Source/BugsnagNotifier.m +++ b/Source/BugsnagClient.m @@ -1,5 +1,5 @@ // -// BugsnagNotifier.m +// BugsnagClient.m // // Created by Conrad Irwin on 2014-10-01. // @@ -24,7 +24,7 @@ // THE SOFTWARE. // -#import "BugsnagNotifier.h" +#import "BugsnagClient.h" #import "BSGConnectivity.h" #import "Bugsnag.h" #import "Private.h" @@ -62,7 +62,7 @@ char *metadataJSON; // Contains the Bugsnag configuration, all under the "config" tab. char *configJSON; - // Contains notifier state, under "deviceState" and crash-specific + // Contains Notifier state, under "deviceState" and crash-specific // information under "crash". char *stateJSON; // Contains properties in the Bugsnag payload overridden by the user before @@ -201,7 +201,7 @@ void BSGWriteSessionCrashData(BugsnagSession *session) { hasRecordedSessions = true; } -@interface BugsnagNotifier () +@interface BugsnagClient () @property(nonatomic, strong) BugsnagCrashSentry *crashSentry; @property(nonatomic, strong) BugsnagErrorReportApiClient *errorReportApiClient; @property(nonatomic, strong, readwrite) BugsnagSessionTracker *sessionTracker; @@ -209,7 +209,7 @@ @interface BugsnagNotifier () @property (nonatomic) BOOL appCrashedLastLaunch; @end -@implementation BugsnagNotifier +@implementation BugsnagClient @synthesize configuration; @@ -527,7 +527,7 @@ - (void)setupConnectivityListener { // ARC Reference - 4.2 __weak Semantics // http://clang.llvm.org/docs/AutomaticReferenceCounting.html - // Avoid potential strong reference cycle between the notifier instance and + // Avoid potential strong reference cycle between the 'client' instance and // the BSGConnectivity static storage. __weak typeof(self) weakSelf = self; [BSGConnectivity monitorURL:url @@ -681,7 +681,7 @@ - (void)notify:(NSException *)exception // 2 -[BSG_KSCrash // reportUserException:reason:language:lineOfCode:stackTrace:terminateProgram:] // 3 -[BugsnagCrashSentry reportUserException:reason:] - // 4 -[BugsnagNotifier notify:message:block:] + // 4 -[BugsnagClient notify:message:block:] int depth = (int)(BSGNotifierStackFrameCount + report.depth); diff --git a/Source/BugsnagConfiguration.h b/Source/BugsnagConfiguration.h index ab312a543..33fcbc041 100644 --- a/Source/BugsnagConfiguration.h +++ b/Source/BugsnagConfiguration.h @@ -206,7 +206,7 @@ NSArray *onSessionBlocks; @property(readonly, retain, nullable) NSURL *sessionURL; @property(retain, nullable) NSString *codeBundleId; -@property(retain, nullable) NSString *notifierType; +@property(retain, nullable) NSString *clientType; /** * The maximum number of breadcrumbs to keep and sent to Bugsnag. diff --git a/Source/BugsnagConfiguration.m b/Source/BugsnagConfiguration.m index 16b5ddc68..3913487f4 100644 --- a/Source/BugsnagConfiguration.m +++ b/Source/BugsnagConfiguration.m @@ -26,7 +26,7 @@ #import "BugsnagConfiguration.h" #import "Bugsnag.h" -#import "BugsnagNotifier.h" +#import "BugsnagClient.h" #import "BugsnagKeys.h" #import "BSG_RFC3339DateTool.h" #import "BugsnagUser.h" @@ -49,10 +49,10 @@ NSString * const kBugsnagUserUserId = @"BugsnagUserUserId"; @interface Bugsnag () -+ (BugsnagNotifier *)notifier; ++ (BugsnagClient *)client; @end -@interface BugsnagNotifier () +@interface BugsnagClient () @property BugsnagSessionTracker *sessionTracker; @end @@ -368,7 +368,7 @@ - (void)setAutoDetectErrors:(BOOL)autoDetectErrors { } [self willChangeValueForKey:NSStringFromSelector(@selector(autoDetectErrors))]; _autoDetectErrors = autoDetectErrors; - [[Bugsnag notifier] updateCrashDetectionSettings]; + [[Bugsnag client] updateCrashDetectionSettings]; [self didChangeValueForKey:NSStringFromSelector(@selector(autoDetectErrors))]; } diff --git a/Source/BugsnagErrorReportApiClient.m b/Source/BugsnagErrorReportApiClient.m index 18b2d1cef..2792a995d 100644 --- a/Source/BugsnagErrorReportApiClient.m +++ b/Source/BugsnagErrorReportApiClient.m @@ -9,7 +9,7 @@ #import "BugsnagErrorReportApiClient.h" #import "Bugsnag.h" #import "BugsnagLogger.h" -#import "BugsnagNotifier.h" +#import "BugsnagClient.h" #import "BugsnagSink.h" #import "BugsnagKeys.h" diff --git a/Source/BugsnagKSCrashSysInfoParser.m b/Source/BugsnagKSCrashSysInfoParser.m index 3fbbd3819..7a03b2a16 100644 --- a/Source/BugsnagKSCrashSysInfoParser.m +++ b/Source/BugsnagKSCrashSysInfoParser.m @@ -103,19 +103,19 @@ BSGDictSetSafeObject(app, codeBundleId, @"codeBundleId"); - NSString *notifierType; + NSString *clientType; #if TARGET_OS_TV - notifierType = @"tvOS"; + clientType = @"tvOS"; #elif TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - notifierType = @"iOS"; + clientType = @"iOS"; #elif TARGET_OS_MAC - notifierType = @"macOS"; + clientType = @"macOS"; #endif - if ([Bugsnag configuration].notifierType) { - notifierType = [Bugsnag configuration].notifierType; + if ([Bugsnag configuration].clientType) { + clientType = [Bugsnag configuration].clientType; } - BSGDictSetSafeObject(app, notifierType, @"type"); + BSGDictSetSafeObject(app, clientType, @"type"); return app; } diff --git a/Source/BugsnagSessionTrackingPayload.m b/Source/BugsnagSessionTrackingPayload.m index 9f96f6a36..108886fca 100644 --- a/Source/BugsnagSessionTrackingPayload.m +++ b/Source/BugsnagSessionTrackingPayload.m @@ -8,7 +8,7 @@ #import "BugsnagSessionTrackingPayload.h" #import "BugsnagCollections.h" -#import "BugsnagNotifier.h" +#import "BugsnagClient.h" #import "Bugsnag.h" #import "BugsnagKeys.h" #import "BSG_KSSystemInfo.h" @@ -16,7 +16,7 @@ #import "Private.h" @interface Bugsnag () -+ (BugsnagNotifier *)notifier; ++ (BugsnagClient *)client; @end @implementation BugsnagSessionTrackingPayload @@ -37,7 +37,7 @@ - (NSMutableDictionary *)toJson { [sessionData addObject:[session toJson]]; } BSGDictInsertIfNotNil(dict, sessionData, @"sessions"); - BSGDictSetSafeObject(dict, [Bugsnag notifier].details, BSGKeyNotifier); + BSGDictSetSafeObject(dict, [Bugsnag client].details, BSGKeyNotifier); NSDictionary *systemInfo = [BSG_KSSystemInfo systemInfo]; BSGDictSetSafeObject(dict, BSGParseAppState(systemInfo, diff --git a/Source/BugsnagSink.m b/Source/BugsnagSink.m index 36f7d4e68..420db9164 100644 --- a/Source/BugsnagSink.m +++ b/Source/BugsnagSink.m @@ -28,7 +28,7 @@ #import "Bugsnag.h" #import "BugsnagLogger.h" #import "BugsnagCollections.h" -#import "BugsnagNotifier.h" +#import "BugsnagClient.h" #import "BugsnagKeys.h" #import "BSG_KSSystemInfo.h" #import "Private.h" @@ -36,7 +36,7 @@ // This is private in Bugsnag, but really we want package private so define // it here. @interface Bugsnag () -+ (BugsnagNotifier *)notifier; ++ (BugsnagClient *)client; @end @implementation BugsnagSink @@ -110,8 +110,8 @@ - (void)filterReports:(NSDictionary *)reports // Generates the payload for notifying Bugsnag - (NSDictionary *)getBodyFromReports:(NSArray *)reports { NSMutableDictionary *data = [[NSMutableDictionary alloc] init]; - BSGDictSetSafeObject(data, [Bugsnag notifier].details, BSGKeyNotifier); - BSGDictSetSafeObject(data, [Bugsnag notifier].configuration.apiKey, BSGKeyApiKey); + BSGDictSetSafeObject(data, [Bugsnag client].details, BSGKeyNotifier); + BSGDictSetSafeObject(data, [Bugsnag client].configuration.apiKey, BSGKeyApiKey); BSGDictSetSafeObject(data, @"4.0", @"payloadVersion"); NSMutableArray *formatted = diff --git a/Tests/BugsnagBaseUnitTest.m b/Tests/BugsnagBaseUnitTest.m index 9a55a74b8..c47b30727 100644 --- a/Tests/BugsnagBaseUnitTest.m +++ b/Tests/BugsnagBaseUnitTest.m @@ -26,7 +26,7 @@ @implementation BugsnagBaseUnitTest * * We take the former approach. * - * @param willNotify Whether the notifier should actually send the event to the server + * @param willNotify Whether the Notifier should actually send the event to the server * @param willPersistUser Whether any user information should be persisted */ diff --git a/iOS/Bugsnag.xcodeproj/project.pbxproj b/iOS/Bugsnag.xcodeproj/project.pbxproj index 19134e9ae..fbd812463 100644 --- a/iOS/Bugsnag.xcodeproj/project.pbxproj +++ b/iOS/Bugsnag.xcodeproj/project.pbxproj @@ -39,7 +39,7 @@ 8A2C8F581C6BBE3C00846019 /* BugsnagEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8F461C6BBE3C00846019 /* BugsnagEvent.m */; }; 8A2C8F5B1C6BBE3C00846019 /* BugsnagMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A2C8F491C6BBE3C00846019 /* BugsnagMetadata.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8A2C8F5C1C6BBE3C00846019 /* BugsnagMetadata.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8F4A1C6BBE3C00846019 /* BugsnagMetadata.m */; }; - 8A2C8F5E1C6BBE3C00846019 /* BugsnagNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8F4C1C6BBE3C00846019 /* BugsnagNotifier.m */; }; + 8A2C8F5E1C6BBE3C00846019 /* BugsnagClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8F4C1C6BBE3C00846019 /* BugsnagClient.m */; }; 8A2C8F5F1C6BBE3C00846019 /* BugsnagSink.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A2C8F4D1C6BBE3C00846019 /* BugsnagSink.h */; }; 8A2C8F601C6BBE3C00846019 /* BugsnagSink.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8F4E1C6BBE3C00846019 /* BugsnagSink.m */; }; 8A2C8F6C1C6BBE9500846019 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A2C8F6B1C6BBE9500846019 /* SystemConfiguration.framework */; }; @@ -194,7 +194,7 @@ E7397E2C1F83BC2A0034242A /* BugsnagConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8F441C6BBE3C00846019 /* BugsnagConfiguration.m */; }; E7397E2D1F83BC2A0034242A /* BugsnagEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8F461C6BBE3C00846019 /* BugsnagEvent.m */; }; E7397E2E1F83BC2A0034242A /* BugsnagMetadata.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8F4A1C6BBE3C00846019 /* BugsnagMetadata.m */; }; - E7397E2F1F83BC2A0034242A /* BugsnagNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8F4C1C6BBE3C00846019 /* BugsnagNotifier.m */; }; + E7397E2F1F83BC2A0034242A /* BugsnagClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8F4C1C6BBE3C00846019 /* BugsnagClient.m */; }; E7397E301F83BC2A0034242A /* BugsnagSink.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8F4E1C6BBE3C00846019 /* BugsnagSink.m */; }; E7397E311F83BC2A0034242A /* BugsnagHandledState.m in Sources */ = {isa = PBXBuildFile; fileRef = E737DEA11F73AD7400BC7C80 /* BugsnagHandledState.m */; }; E7397E321F83BC320034242A /* BSG_KSCrashC.c in Sources */ = {isa = PBXBuildFile; fileRef = E7107BC81F4C97F100BB3F98 /* BSG_KSCrashC.c */; }; @@ -272,7 +272,7 @@ E7397EEA1F83CFC20034242A /* BugsnagConfiguration.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8A2C8F431C6BBE3C00846019 /* BugsnagConfiguration.h */; }; E7397EEB1F83CFC20034242A /* BugsnagEvent.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8A2C8F451C6BBE3C00846019 /* BugsnagEvent.h */; }; E7397EEC1F83CFC20034242A /* BugsnagMetadata.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8A2C8F491C6BBE3C00846019 /* BugsnagMetadata.h */; }; - E7397EED1F83CFC20034242A /* BugsnagNotifier.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8A2C8F4B1C6BBE3C00846019 /* BugsnagNotifier.h */; }; + E7397EED1F83CFC20034242A /* BugsnagClient.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8A2C8F4B1C6BBE3C00846019 /* BugsnagClient.h */; }; E7397EEE1F83CFC20034242A /* BugsnagSink.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8A2C8F4D1C6BBE3C00846019 /* BugsnagSink.h */; }; E7397EEF1F83CFC20034242A /* BugsnagHandledState.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = E737DEA01F73AD7400BC7C80 /* BugsnagHandledState.h */; }; E7433AD01F4F64D400C082D1 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A2C8F6F1C6BBE9F00846019 /* libc++.tbd */; }; @@ -301,7 +301,7 @@ E7B3291A1FD707EC0098FC47 /* KSCrashReportConverter_Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7B329171FD707EC0098FC47 /* KSCrashReportConverter_Tests.m */; }; E7B970311FD702DA00590C27 /* KSLogger_Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7B970301FD702DA00590C27 /* KSLogger_Tests.m */; }; E7B970341FD7031500590C27 /* XCTestCase+KSCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = E7B970331FD7031500590C27 /* XCTestCase+KSCrash.m */; }; - E7DC009A1FC5C4F6004AB8DF /* BugsnagNotifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A2C8F4B1C6BBE3C00846019 /* BugsnagNotifier.h */; }; + E7DC009A1FC5C4F6004AB8DF /* BugsnagClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A2C8F4B1C6BBE3C00846019 /* BugsnagClient.h */; }; E7DC009B1FC5C4F6004AB8DF /* BugsnagCollections.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A2C8F411C6BBE3C00846019 /* BugsnagCollections.h */; }; E7E08C531FCF1F05000C14C9 /* BugsnagFileStore.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F42953E7E61199381E0405CC /* BugsnagFileStore.h */; }; E7EB06741FCDAF2000C076A6 /* BugsnagKSCrashSysInfoParser.h in Headers */ = {isa = PBXBuildFile; fileRef = E7EB06721FCDAF2000C076A6 /* BugsnagKSCrashSysInfoParser.h */; }; @@ -408,7 +408,7 @@ E7397EEB1F83CFC20034242A /* BugsnagEvent.h in CopyFiles */, E7397EEC1F83CFC20034242A /* BugsnagMetadata.h in CopyFiles */, E7397EEC1F83CFC20034242A /* BugsnagMetadata.h in CopyFiles */, - E7397EED1F83CFC20034242A /* BugsnagNotifier.h in CopyFiles */, + E7397EED1F83CFC20034242A /* BugsnagClient.h in CopyFiles */, E7397EEE1F83CFC20034242A /* BugsnagSink.h in CopyFiles */, E7397EEF1F83CFC20034242A /* BugsnagHandledState.h in CopyFiles */, ); @@ -457,8 +457,8 @@ 8A2C8F461C6BBE3C00846019 /* BugsnagEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagEvent.m; path = ../Source/BugsnagEvent.m; sourceTree = SOURCE_ROOT; }; 8A2C8F491C6BBE3C00846019 /* BugsnagMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagMetadata.h; path = ../Source/BugsnagMetadata.h; sourceTree = SOURCE_ROOT; }; 8A2C8F4A1C6BBE3C00846019 /* BugsnagMetadata.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagMetadata.m; path = ../Source/BugsnagMetadata.m; sourceTree = SOURCE_ROOT; }; - 8A2C8F4B1C6BBE3C00846019 /* BugsnagNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagNotifier.h; path = ../Source/BugsnagNotifier.h; sourceTree = SOURCE_ROOT; }; - 8A2C8F4C1C6BBE3C00846019 /* BugsnagNotifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagNotifier.m; path = ../Source/BugsnagNotifier.m; sourceTree = SOURCE_ROOT; }; + 8A2C8F4B1C6BBE3C00846019 /* BugsnagClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagClient.h; path = ../Source/BugsnagClient.h; sourceTree = SOURCE_ROOT; }; + 8A2C8F4C1C6BBE3C00846019 /* BugsnagClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagClient.m; path = ../Source/BugsnagClient.m; sourceTree = SOURCE_ROOT; }; 8A2C8F4D1C6BBE3C00846019 /* BugsnagSink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagSink.h; path = ../Source/BugsnagSink.h; sourceTree = SOURCE_ROOT; }; 8A2C8F4E1C6BBE3C00846019 /* BugsnagSink.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagSink.m; path = ../Source/BugsnagSink.m; sourceTree = SOURCE_ROOT; }; 8A2C8F6B1C6BBE9500846019 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; @@ -721,6 +721,8 @@ F4295E2778677786239F2B28 /* BugsnagApiClient.m */, 8A2C8F3F1C6BBE3C00846019 /* BugsnagBreadcrumb.h */, 8A2C8F401C6BBE3C00846019 /* BugsnagBreadcrumb.m */, + 8A2C8F4B1C6BBE3C00846019 /* BugsnagClient.h */, + 8A2C8F4C1C6BBE3C00846019 /* BugsnagClient.m */, 8A2C8F411C6BBE3C00846019 /* BugsnagCollections.h */, 8A2C8F421C6BBE3C00846019 /* BugsnagCollections.m */, 8A2C8F431C6BBE3C00846019 /* BugsnagConfiguration.h */, @@ -741,8 +743,6 @@ 8A381D491EAA49A700AF8429 /* BugsnagLogger.h */, 8A2C8F491C6BBE3C00846019 /* BugsnagMetadata.h */, 8A2C8F4A1C6BBE3C00846019 /* BugsnagMetadata.m */, - 8A2C8F4B1C6BBE3C00846019 /* BugsnagNotifier.h */, - 8A2C8F4C1C6BBE3C00846019 /* BugsnagNotifier.m */, E72BF7781FC869F7004BE82F /* BugsnagSession.h */, E72BF7791FC869F7004BE82F /* BugsnagSession.m */, F42955025DBE1DCEFD928CAA /* BugsnagSessionFileStore.h */, @@ -1063,7 +1063,7 @@ E7107C541F4C97F100BB3F98 /* BSG_KSCrashSentry_Private.h in Headers */, 0061D84B24067AF80041C068 /* BSG_SSKeychain.h in Headers */, E7EB06741FCDAF2000C076A6 /* BugsnagKSCrashSysInfoParser.h in Headers */, - E7DC009A1FC5C4F6004AB8DF /* BugsnagNotifier.h in Headers */, + E7DC009A1FC5C4F6004AB8DF /* BugsnagClient.h in Headers */, E737DEA21F73AD7400BC7C80 /* BugsnagHandledState.h in Headers */, E7107C351F4C97F100BB3F98 /* BSG_KSCrashAdvanced.h in Headers */, E7107C711F4C97F100BB3F98 /* BSG_KSObjC.h in Headers */, @@ -1225,7 +1225,7 @@ E7107C691F4C97F100BB3F98 /* BSG_KSMach.c in Sources */, E7107C441F4C97F100BB3F98 /* BSG_KSCrashType.c in Sources */, E7107C6B1F4C97F100BB3F98 /* BSG_KSMach_Arm.c in Sources */, - 8A2C8F5E1C6BBE3C00846019 /* BugsnagNotifier.m in Sources */, + 8A2C8F5E1C6BBE3C00846019 /* BugsnagClient.m in Sources */, E7107C3A1F4C97F100BB3F98 /* BSG_KSCrashDoctor.m in Sources */, E7107C421F4C97F100BB3F98 /* BSG_KSCrashState.m in Sources */, E72BF77B1FC869F7004BE82F /* BugsnagSession.m in Sources */, @@ -1381,7 +1381,7 @@ E7397E2D1F83BC2A0034242A /* BugsnagEvent.m in Sources */, E7397E2E1F83BC2A0034242A /* BugsnagMetadata.m in Sources */, E7397E2E1F83BC2A0034242A /* BugsnagMetadata.m in Sources */, - E7397E2F1F83BC2A0034242A /* BugsnagNotifier.m in Sources */, + E7397E2F1F83BC2A0034242A /* BugsnagClient.m in Sources */, E7397E301F83BC2A0034242A /* BugsnagSink.m in Sources */, E7397E311F83BC2A0034242A /* BugsnagHandledState.m in Sources */, F42954D2337A7CAE1FE9B308 /* BugsnagFileStore.m in Sources */, From a691f0bc50fee881943b58c29ff2ee5c83e9311f Mon Sep 17 00:00:00 2001 From: Robin Macharg Date: Thu, 5 Mar 2020 17:13:06 +0000 Subject: [PATCH 2/4] Updated OSX & tvOS projects, rolled back a couple of renames. --- OSX/Bugsnag.xcodeproj/project.pbxproj | 16 ++++++++-------- Source/BugsnagClient.m | 2 +- Source/BugsnagConfiguration.h | 2 +- Source/BugsnagKSCrashSysInfoParser.m | 4 ++-- Tests/BugsnagBaseUnitTest.m | 2 +- tvOS/Bugsnag.xcodeproj/project.pbxproj | 16 ++++++++-------- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/OSX/Bugsnag.xcodeproj/project.pbxproj b/OSX/Bugsnag.xcodeproj/project.pbxproj index 7d9b95233..8a30dce2e 100644 --- a/OSX/Bugsnag.xcodeproj/project.pbxproj +++ b/OSX/Bugsnag.xcodeproj/project.pbxproj @@ -11,6 +11,8 @@ 0061D83A2405B23A0041C068 /* BSG_SSKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = 0061D8372405B23A0041C068 /* BSG_SSKeychain.m */; }; 0061D83B2405B23A0041C068 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 0061D8382405B23A0041C068 /* LICENSE */; }; 0061D83C2405B23A0041C068 /* BSG_SSKeychain.h in Headers */ = {isa = PBXBuildFile; fileRef = 0061D8392405B23A0041C068 /* BSG_SSKeychain.h */; }; + 0089B6EB2411682000D5A7F2 /* BugsnagClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 0089B6E92411682000D5A7F2 /* BugsnagClient.m */; }; + 0089B6EC2411682000D5A7F2 /* BugsnagClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0089B6EA2411682000D5A7F2 /* BugsnagClient.h */; }; 00D7AC9C23E97F8100FBE4A7 /* BugsnagEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 00D7AC9A23E97F8100FBE4A7 /* BugsnagEvent.m */; }; 00D7AC9D23E97F8100FBE4A7 /* BugsnagEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 00D7AC9B23E97F8100FBE4A7 /* BugsnagEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; 00D7ACA423E9854C00FBE4A7 /* BugsnagEventTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00D7ACA223E984B300FBE4A7 /* BugsnagEventTests.m */; }; @@ -30,8 +32,6 @@ 8A2C8FD41C6BC2C800846019 /* BugsnagConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8FC21C6BC2C800846019 /* BugsnagConfiguration.m */; }; 8A2C8FD71C6BC2C800846019 /* BugsnagMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A2C8FC51C6BC2C800846019 /* BugsnagMetadata.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8A2C8FD81C6BC2C800846019 /* BugsnagMetadata.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8FC61C6BC2C800846019 /* BugsnagMetadata.m */; }; - 8A2C8FD91C6BC2C800846019 /* BugsnagNotifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A2C8FC71C6BC2C800846019 /* BugsnagNotifier.h */; }; - 8A2C8FDA1C6BC2C800846019 /* BugsnagNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8FC81C6BC2C800846019 /* BugsnagNotifier.m */; }; 8A2C8FDD1C6BC2C800846019 /* BugsnagSink.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A2C8FCB1C6BC2C800846019 /* BugsnagSink.h */; }; 8A2C8FDE1C6BC2C800846019 /* BugsnagSink.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8FCC1C6BC2C800846019 /* BugsnagSink.m */; }; 8A2C8FEA1C6BC38900846019 /* BugsnagBreadcrumbsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C8FE01C6BC38200846019 /* BugsnagBreadcrumbsTest.m */; }; @@ -194,6 +194,8 @@ 0061D8372405B23A0041C068 /* BSG_SSKeychain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSG_SSKeychain.m; sourceTree = ""; }; 0061D8382405B23A0041C068 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 0061D8392405B23A0041C068 /* BSG_SSKeychain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSG_SSKeychain.h; sourceTree = ""; }; + 0089B6E92411682000D5A7F2 /* BugsnagClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagClient.m; path = ../Source/BugsnagClient.m; sourceTree = ""; }; + 0089B6EA2411682000D5A7F2 /* BugsnagClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagClient.h; path = ../Source/BugsnagClient.h; sourceTree = ""; }; 00D7AC9A23E97F8100FBE4A7 /* BugsnagEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagEvent.m; path = ../Source/BugsnagEvent.m; sourceTree = ""; }; 00D7AC9B23E97F8100FBE4A7 /* BugsnagEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagEvent.h; path = ../Source/BugsnagEvent.h; sourceTree = ""; }; 00D7ACA223E984B300FBE4A7 /* BugsnagEventTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BugsnagEventTests.m; sourceTree = ""; }; @@ -218,8 +220,6 @@ 8A2C8FC21C6BC2C800846019 /* BugsnagConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagConfiguration.m; path = ../Source/BugsnagConfiguration.m; sourceTree = SOURCE_ROOT; }; 8A2C8FC51C6BC2C800846019 /* BugsnagMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagMetadata.h; path = ../Source/BugsnagMetadata.h; sourceTree = SOURCE_ROOT; }; 8A2C8FC61C6BC2C800846019 /* BugsnagMetadata.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagMetadata.m; path = ../Source/BugsnagMetadata.m; sourceTree = SOURCE_ROOT; }; - 8A2C8FC71C6BC2C800846019 /* BugsnagNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagNotifier.h; path = ../Source/BugsnagNotifier.h; sourceTree = SOURCE_ROOT; }; - 8A2C8FC81C6BC2C800846019 /* BugsnagNotifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagNotifier.m; path = ../Source/BugsnagNotifier.m; sourceTree = SOURCE_ROOT; }; 8A2C8FCB1C6BC2C800846019 /* BugsnagSink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagSink.h; path = ../Source/BugsnagSink.h; sourceTree = SOURCE_ROOT; }; 8A2C8FCC1C6BC2C800846019 /* BugsnagSink.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagSink.m; path = ../Source/BugsnagSink.m; sourceTree = SOURCE_ROOT; }; 8A2C8FE01C6BC38200846019 /* BugsnagBreadcrumbsTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagBreadcrumbsTest.m; path = ../Tests/BugsnagBreadcrumbsTest.m; sourceTree = SOURCE_ROOT; }; @@ -437,6 +437,8 @@ 8A6C6FAF2257884C00E8EF24 /* BSGOutOfMemoryWatchdog.m */, E791483E1FD82B35003EFEBF /* BugsnagApiClient.h */, E791483D1FD82B35003EFEBF /* BugsnagApiClient.m */, + 0089B6EA2411682000D5A7F2 /* BugsnagClient.h */, + 0089B6E92411682000D5A7F2 /* BugsnagClient.m */, E79148401FD82B35003EFEBF /* BugsnagFileStore.h */, E79148451FD82B36003EFEBF /* BugsnagFileStore.m */, E79148341FD82B34003EFEBF /* BugsnagKSCrashSysInfoParser.h */, @@ -476,8 +478,6 @@ 8A2C8FC21C6BC2C800846019 /* BugsnagConfiguration.m */, 8A2C8FC51C6BC2C800846019 /* BugsnagMetadata.h */, 8A2C8FC61C6BC2C800846019 /* BugsnagMetadata.m */, - 8A2C8FC71C6BC2C800846019 /* BugsnagNotifier.h */, - 8A2C8FC81C6BC2C800846019 /* BugsnagNotifier.m */, 8A2C8FCB1C6BC2C800846019 /* BugsnagSink.h */, 8A2C8FCC1C6BC2C800846019 /* BugsnagSink.m */, 8A2C8FA61C6BC1F700846019 /* Info.plist */, @@ -763,6 +763,7 @@ 8A2C8FCF1C6BC2C800846019 /* BugsnagBreadcrumb.h in Headers */, E79148511FD82B36003EFEBF /* BugsnagApiClient.h in Headers */, E79E6BDB1F4E3850002B35F9 /* BSG_KSCrashReportFilter.h in Headers */, + 0089B6EC2411682000D5A7F2 /* BugsnagClient.h in Headers */, E79E6BA11F4E3850002B35F9 /* BSG_KSCrashSentry_CPPException.h in Headers */, E79E6B041F4E3847002B35F9 /* BugsnagErrorReportApiClient.h in Headers */, 8A530CB822FDC38300F0C108 /* BSG_KSCrashIdentifier.h in Headers */, @@ -775,7 +776,6 @@ E79E6BA01F4E3850002B35F9 /* BSG_KSCrashSentry.h in Headers */, E79E6BA91F4E3850002B35F9 /* BSG_KSCrashSentry_Private.h in Headers */, E79148481FD82B36003EFEBF /* BugsnagUser.h in Headers */, - 8A2C8FD91C6BC2C800846019 /* BugsnagNotifier.h in Headers */, E79E6B8A1F4E3850002B35F9 /* BSG_KSCrashAdvanced.h in Headers */, E79E6BC61F4E3850002B35F9 /* BSG_KSObjC.h in Headers */, E79E6BCE1F4E3850002B35F9 /* BSG_KSString.h in Headers */, @@ -894,10 +894,10 @@ 8A627CDA1EC3B75200F7C04E /* BSGSerialization.m in Sources */, E79E6BAA1F4E3850002B35F9 /* BSG_KSCrashSentry_Signal.c in Sources */, 8A2C8FDE1C6BC2C800846019 /* BugsnagSink.m in Sources */, + 0089B6EB2411682000D5A7F2 /* BugsnagClient.m in Sources */, E79E6BBE1F4E3850002B35F9 /* BSG_KSMach.c in Sources */, E79E6B991F4E3850002B35F9 /* BSG_KSCrashType.c in Sources */, E79E6BC01F4E3850002B35F9 /* BSG_KSMach_Arm.c in Sources */, - 8A2C8FDA1C6BC2C800846019 /* BugsnagNotifier.m in Sources */, E79E6B8F1F4E3850002B35F9 /* BSG_KSCrashDoctor.m in Sources */, E791484E1FD82B36003EFEBF /* BugsnagKSCrashSysInfoParser.m in Sources */, E791484F1FD82B36003EFEBF /* BugsnagSessionTrackingPayload.m in Sources */, diff --git a/Source/BugsnagClient.m b/Source/BugsnagClient.m index 08d9929e4..561ffb5f4 100644 --- a/Source/BugsnagClient.m +++ b/Source/BugsnagClient.m @@ -62,7 +62,7 @@ char *metadataJSON; // Contains the Bugsnag configuration, all under the "config" tab. char *configJSON; - // Contains Notifier state, under "deviceState" and crash-specific + // Contains notifier state, under "deviceState" and crash-specific // information under "crash". char *stateJSON; // Contains properties in the Bugsnag payload overridden by the user before diff --git a/Source/BugsnagConfiguration.h b/Source/BugsnagConfiguration.h index 33fcbc041..ab312a543 100644 --- a/Source/BugsnagConfiguration.h +++ b/Source/BugsnagConfiguration.h @@ -206,7 +206,7 @@ NSArray *onSessionBlocks; @property(readonly, retain, nullable) NSURL *sessionURL; @property(retain, nullable) NSString *codeBundleId; -@property(retain, nullable) NSString *clientType; +@property(retain, nullable) NSString *notifierType; /** * The maximum number of breadcrumbs to keep and sent to Bugsnag. diff --git a/Source/BugsnagKSCrashSysInfoParser.m b/Source/BugsnagKSCrashSysInfoParser.m index 7a03b2a16..ded0fb729 100644 --- a/Source/BugsnagKSCrashSysInfoParser.m +++ b/Source/BugsnagKSCrashSysInfoParser.m @@ -112,8 +112,8 @@ clientType = @"macOS"; #endif - if ([Bugsnag configuration].clientType) { - clientType = [Bugsnag configuration].clientType; + if ([Bugsnag configuration].notifierType) { + clientType = [Bugsnag configuration].notifierType; } BSGDictSetSafeObject(app, clientType, @"type"); return app; diff --git a/Tests/BugsnagBaseUnitTest.m b/Tests/BugsnagBaseUnitTest.m index c47b30727..9a55a74b8 100644 --- a/Tests/BugsnagBaseUnitTest.m +++ b/Tests/BugsnagBaseUnitTest.m @@ -26,7 +26,7 @@ @implementation BugsnagBaseUnitTest * * We take the former approach. * - * @param willNotify Whether the Notifier should actually send the event to the server + * @param willNotify Whether the notifier should actually send the event to the server * @param willPersistUser Whether any user information should be persisted */ diff --git a/tvOS/Bugsnag.xcodeproj/project.pbxproj b/tvOS/Bugsnag.xcodeproj/project.pbxproj index 70d67a8db..c4866603f 100644 --- a/tvOS/Bugsnag.xcodeproj/project.pbxproj +++ b/tvOS/Bugsnag.xcodeproj/project.pbxproj @@ -11,6 +11,8 @@ 0061D8402405B6370041C068 /* BSG_SSKeychain.h in Headers */ = {isa = PBXBuildFile; fileRef = 0061D83D2405B6370041C068 /* BSG_SSKeychain.h */; }; 0061D8412405B6370041C068 /* BSG_SSKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = 0061D83E2405B6370041C068 /* BSG_SSKeychain.m */; }; 0061D8422405B6370041C068 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 0061D83F2405B6370041C068 /* LICENSE */; }; + 0089B6EF241168CC00D5A7F2 /* BugsnagClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0089B6ED241168CB00D5A7F2 /* BugsnagClient.h */; }; + 0089B6F0241168CC00D5A7F2 /* BugsnagClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 0089B6EE241168CB00D5A7F2 /* BugsnagClient.m */; }; 00D7ACA023E97FBD00FBE4A7 /* BugsnagEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 00D7AC9E23E97FBD00FBE4A7 /* BugsnagEvent.m */; }; 00D7ACA123E97FBD00FBE4A7 /* BugsnagEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 00D7AC9F23E97FBD00FBE4A7 /* BugsnagEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; 00D7ACA723E98A5D00FBE4A7 /* BugsnagEventTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00D7ACA623E98A5D00FBE4A7 /* BugsnagEventTests.m */; }; @@ -43,14 +45,12 @@ 8AD9A4F71D42EE90004E1CC5 /* BugsnagCollections.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB1512A1D41366400C9B218 /* BugsnagCollections.h */; }; 8AD9A4F81D42EE96004E1CC5 /* BugsnagConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB1512C1D41366400C9B218 /* BugsnagConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8AD9A4FA1D42EE96004E1CC5 /* BugsnagMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB151301D41366400C9B218 /* BugsnagMetadata.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8AD9A4FB1D42EE96004E1CC5 /* BugsnagNotifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB151321D41366400C9B218 /* BugsnagNotifier.h */; }; 8AD9A4FC1D42EE96004E1CC5 /* BugsnagSink.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB151341D41366400C9B218 /* BugsnagSink.h */; }; 8AD9A4FD1D42EE99004E1CC5 /* Bugsnag.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AB151271D41366400C9B218 /* Bugsnag.m */; }; 8AD9A4FE1D42EE9D004E1CC5 /* BugsnagBreadcrumb.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AB151291D41366400C9B218 /* BugsnagBreadcrumb.m */; }; 8AD9A4FF1D42EEA0004E1CC5 /* BugsnagCollections.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AB1512B1D41366400C9B218 /* BugsnagCollections.m */; }; 8AD9A5001D42EEA9004E1CC5 /* BugsnagConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AB1512D1D41366400C9B218 /* BugsnagConfiguration.m */; }; 8AD9A5021D42EEB0004E1CC5 /* BugsnagMetadata.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AB151311D41366400C9B218 /* BugsnagMetadata.m */; }; - 8AD9A5031D42EEB0004E1CC5 /* BugsnagNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AB151331D41366400C9B218 /* BugsnagNotifier.m */; }; 8AD9A5041D42EEB0004E1CC5 /* BugsnagSink.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AB151351D41366400C9B218 /* BugsnagSink.m */; }; 8AD9A5051D42EEE9004E1CC5 /* BSG_KSCrashReportWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB151251D41366400C9B218 /* BSG_KSCrashReportWriter.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8AD9FA8D1E0863A1002859A7 /* BugsnagConfigurationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AD9FA8B1E0863A1002859A7 /* BugsnagConfigurationTests.m */; }; @@ -199,6 +199,8 @@ 0061D83D2405B6370041C068 /* BSG_SSKeychain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSG_SSKeychain.h; sourceTree = ""; }; 0061D83E2405B6370041C068 /* BSG_SSKeychain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSG_SSKeychain.m; sourceTree = ""; }; 0061D83F2405B6370041C068 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; + 0089B6ED241168CB00D5A7F2 /* BugsnagClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagClient.h; path = ../Source/BugsnagClient.h; sourceTree = ""; }; + 0089B6EE241168CB00D5A7F2 /* BugsnagClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagClient.m; path = ../Source/BugsnagClient.m; sourceTree = ""; }; 00D7AC9E23E97FBD00FBE4A7 /* BugsnagEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagEvent.m; path = ../Source/BugsnagEvent.m; sourceTree = ""; }; 00D7AC9F23E97FBD00FBE4A7 /* BugsnagEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagEvent.h; path = ../Source/BugsnagEvent.h; sourceTree = ""; }; 00D7ACA523E98A5D00FBE4A7 /* BugsnagTestConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagTestConstants.h; path = ../../Tests/BugsnagTestConstants.h; sourceTree = ""; }; @@ -243,8 +245,6 @@ 8AB1512D1D41366400C9B218 /* BugsnagConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagConfiguration.m; path = ../Source/BugsnagConfiguration.m; sourceTree = ""; }; 8AB151301D41366400C9B218 /* BugsnagMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagMetadata.h; path = ../Source/BugsnagMetadata.h; sourceTree = ""; }; 8AB151311D41366400C9B218 /* BugsnagMetadata.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagMetadata.m; path = ../Source/BugsnagMetadata.m; sourceTree = ""; }; - 8AB151321D41366400C9B218 /* BugsnagNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagNotifier.h; path = ../Source/BugsnagNotifier.h; sourceTree = ""; }; - 8AB151331D41366400C9B218 /* BugsnagNotifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagNotifier.m; path = ../Source/BugsnagNotifier.m; sourceTree = ""; }; 8AB151341D41366400C9B218 /* BugsnagSink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugsnagSink.h; path = ../Source/BugsnagSink.h; sourceTree = ""; }; 8AB151351D41366400C9B218 /* BugsnagSink.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagSink.m; path = ../Source/BugsnagSink.m; sourceTree = ""; }; 8AD9FA8B1E0863A1002859A7 /* BugsnagConfigurationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BugsnagConfigurationTests.m; path = ../Tests/BugsnagConfigurationTests.m; sourceTree = SOURCE_ROOT; }; @@ -439,6 +439,8 @@ 8A8D51261D41343500D33797 /* tvOS */ = { isa = PBXGroup; children = ( + 0089B6ED241168CB00D5A7F2 /* BugsnagClient.h */, + 0089B6EE241168CB00D5A7F2 /* BugsnagClient.m */, 00D7AC9F23E97FBD00FBE4A7 /* BugsnagEvent.h */, 00D7AC9E23E97FBD00FBE4A7 /* BugsnagEvent.m */, 8A3C590F23968B2000B344AA /* BugsnagPlugin.h */, @@ -485,8 +487,6 @@ 8AB1512D1D41366400C9B218 /* BugsnagConfiguration.m */, 8AB151301D41366400C9B218 /* BugsnagMetadata.h */, 8AB151311D41366400C9B218 /* BugsnagMetadata.m */, - 8AB151321D41366400C9B218 /* BugsnagNotifier.h */, - 8AB151331D41366400C9B218 /* BugsnagNotifier.m */, 8AB151341D41366400C9B218 /* BugsnagSink.h */, 8AB151351D41366400C9B218 /* BugsnagSink.m */, 8A8D51291D41343500D33797 /* Info.plist */, @@ -779,6 +779,7 @@ 8AD9A4F61D42EE8E004E1CC5 /* BugsnagBreadcrumb.h in Headers */, E79148821FD82E6D003EFEBF /* BugsnagApiClient.h in Headers */, E76617D01F4E459C0094CECF /* BSG_KSCrashReportFilter.h in Headers */, + 0089B6EF241168CC00D5A7F2 /* BugsnagClient.h in Headers */, E76617961F4E459C0094CECF /* BSG_KSCrashSentry_CPPException.h in Headers */, E76616F91F4E45950094CECF /* BugsnagErrorReportApiClient.h in Headers */, 8A530CBD22FDC39300F0C108 /* BSG_KSCrashIdentifier.h in Headers */, @@ -799,7 +800,6 @@ E76617CE1F4E459C0094CECF /* BSG_RFC3339DateTool.h in Headers */, E72352BD1F55923700436528 /* BSGConnectivity.h in Headers */, 8AD9A4F71D42EE90004E1CC5 /* BugsnagCollections.h in Headers */, - 8AD9A4FB1D42EE96004E1CC5 /* BugsnagNotifier.h in Headers */, E79148771FD82E6D003EFEBF /* BugsnagSession.h in Headers */, 8AD9A4FC1D42EE96004E1CC5 /* BugsnagSink.h in Headers */, ); @@ -910,7 +910,7 @@ 8AD9A5001D42EEA9004E1CC5 /* BugsnagConfiguration.m in Sources */, 8A627CD61EC3B69300F7C04E /* BSGSerialization.m in Sources */, E766179F1F4E459C0094CECF /* BSG_KSCrashSentry_Signal.c in Sources */, - 8AD9A5031D42EEB0004E1CC5 /* BugsnagNotifier.m in Sources */, + 0089B6F0241168CC00D5A7F2 /* BugsnagClient.m in Sources */, E79148881FD82E6D003EFEBF /* BugsnagSession.m in Sources */, E791487C1FD82E6D003EFEBF /* BugsnagSessionTrackingApiClient.m in Sources */, E76617B31F4E459C0094CECF /* BSG_KSMach.c in Sources */, From 08247477b616d283dabbb2483abbe9cd9214a17e Mon Sep 17 00:00:00 2001 From: Robin Macharg Date: Fri, 6 Mar 2020 10:57:29 +0000 Subject: [PATCH 3/4] PR feedback --- Source/BugsnagKSCrashSysInfoParser.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/BugsnagKSCrashSysInfoParser.m b/Source/BugsnagKSCrashSysInfoParser.m index ded0fb729..3fbbd3819 100644 --- a/Source/BugsnagKSCrashSysInfoParser.m +++ b/Source/BugsnagKSCrashSysInfoParser.m @@ -103,19 +103,19 @@ BSGDictSetSafeObject(app, codeBundleId, @"codeBundleId"); - NSString *clientType; + NSString *notifierType; #if TARGET_OS_TV - clientType = @"tvOS"; + notifierType = @"tvOS"; #elif TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - clientType = @"iOS"; + notifierType = @"iOS"; #elif TARGET_OS_MAC - clientType = @"macOS"; + notifierType = @"macOS"; #endif if ([Bugsnag configuration].notifierType) { - clientType = [Bugsnag configuration].notifierType; + notifierType = [Bugsnag configuration].notifierType; } - BSGDictSetSafeObject(app, clientType, @"type"); + BSGDictSetSafeObject(app, notifierType, @"type"); return app; } From e02455d7829b838bec11663f216474c2182dc1d4 Mon Sep 17 00:00:00 2001 From: Robin Macharg Date: Mon, 9 Mar 2020 15:05:38 +0000 Subject: [PATCH 4/4] Missed "Notifier" -> "Client" in OOM watchdog test --- iOS/BugsnagTests/BSGOutOfMemoryWatchdogTests.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iOS/BugsnagTests/BSGOutOfMemoryWatchdogTests.m b/iOS/BugsnagTests/BSGOutOfMemoryWatchdogTests.m index 095449861..7233229e4 100644 --- a/iOS/BugsnagTests/BSGOutOfMemoryWatchdogTests.m +++ b/iOS/BugsnagTests/BSGOutOfMemoryWatchdogTests.m @@ -3,16 +3,16 @@ #import "BSG_KSSystemInfo.h" #import "BugsnagConfiguration.h" #import "Bugsnag.h" -#import "BugsnagNotifier.h" +#import "BugsnagClient.h" #import "BugsnagTestConstants.h" // Expose private identifiers for testing @interface Bugsnag (Testing) -+ (BugsnagNotifier *)notifier; ++ (BugsnagClient *)client; @end -@interface BugsnagNotifier (Testing) +@interface BugsnagClient (Testing) @property (nonatomic, strong) BSGOutOfMemoryWatchdog *oomWatchdog; @end @@ -46,7 +46,7 @@ - (void)testNilPathDoesNotCreateWatchdog { * Test that the generated OOM report values exist and are correct (where that can be tested) */ - (void)testOOMFieldsSetCorrectly { - NSMutableDictionary *cachedFileInfo = [[[Bugsnag notifier] oomWatchdog] cachedFileInfo]; + NSMutableDictionary *cachedFileInfo = [[[Bugsnag client] oomWatchdog] cachedFileInfo]; XCTAssertNotNil([cachedFileInfo objectForKey:@"app"]); XCTAssertNotNil([cachedFileInfo objectForKey:@"device"]);