Skip to content

Commit f7633f5

Browse files
cleanup integration protocol (#5227)
* cleanup integration protocol * Format code --------- Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>
1 parent 0ff6aa3 commit f7633f5

26 files changed

+54
-55
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,6 @@
995995
D8CA12952C203E71005894F4 /* SentrySessionListener.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8CA12942C203E71005894F4 /* SentrySessionListener.swift */; };
996996
D8CAC02E2BA0663E00E38F34 /* SentryReplayOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8CAC02A2BA0663E00E38F34 /* SentryReplayOptions.swift */; };
997997
D8CAC02F2BA0663E00E38F34 /* SentryVideoInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8CAC02B2BA0663E00E38F34 /* SentryVideoInfo.swift */; };
998-
D8CAC0412BA0984500E38F34 /* SentryIntegrationProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8CAC0402BA0984500E38F34 /* SentryIntegrationProtocol.swift */; };
999998
D8CAC0732BA4473000E38F34 /* SentryViewPhotographer.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8CAC0722BA4473000E38F34 /* SentryViewPhotographer.swift */; };
1000999
D8CB74152947246600A5F964 /* SentryEnvelopeAttachmentHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = D8CB74142947246600A5F964 /* SentryEnvelopeAttachmentHeader.h */; };
10011000
D8CB7417294724CC00A5F964 /* SentryEnvelopeAttachmentHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = D8CB7416294724CC00A5F964 /* SentryEnvelopeAttachmentHeader.m */; };
@@ -1021,6 +1020,7 @@
10211020
D8F8F5572B835BC600AC5465 /* SentryMsgPackSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D8F8F5562B835BC600AC5465 /* SentryMsgPackSerializerTests.m */; };
10221021
D8FC98AB2CD0DAB30009824C /* BreadcrumbExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8FC98AA2CD0DAAC0009824C /* BreadcrumbExtension.swift */; };
10231022
D8FFE50C2703DBB400607131 /* SwizzlingCallTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8FFE50B2703DAAE00607131 /* SwizzlingCallTests.swift */; };
1023+
FA034AC82DD3DB4900FE3107 /* SentryIntegrationProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = FA034AC72DD3DB4900FE3107 /* SentryIntegrationProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
10241024
/* End PBXBuildFile section */
10251025

10261026
/* Begin PBXContainerItemProxy section */
@@ -2184,7 +2184,6 @@
21842184
D8CA12942C203E71005894F4 /* SentrySessionListener.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySessionListener.swift; sourceTree = "<group>"; };
21852185
D8CAC02A2BA0663E00E38F34 /* SentryReplayOptions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SentryReplayOptions.swift; sourceTree = "<group>"; };
21862186
D8CAC02B2BA0663E00E38F34 /* SentryVideoInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SentryVideoInfo.swift; sourceTree = "<group>"; };
2187-
D8CAC0402BA0984500E38F34 /* SentryIntegrationProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryIntegrationProtocol.swift; sourceTree = "<group>"; };
21882187
D8CAC0722BA4473000E38F34 /* SentryViewPhotographer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryViewPhotographer.swift; sourceTree = "<group>"; };
21892188
D8CB74142947246600A5F964 /* SentryEnvelopeAttachmentHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryEnvelopeAttachmentHeader.h; path = include/SentryEnvelopeAttachmentHeader.h; sourceTree = "<group>"; };
21902189
D8CB7416294724CC00A5F964 /* SentryEnvelopeAttachmentHeader.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryEnvelopeAttachmentHeader.m; sourceTree = "<group>"; };
@@ -2212,6 +2211,7 @@
22122211
D8F8F5562B835BC600AC5465 /* SentryMsgPackSerializerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryMsgPackSerializerTests.m; sourceTree = "<group>"; };
22132212
D8FC98AA2CD0DAAC0009824C /* BreadcrumbExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BreadcrumbExtension.swift; sourceTree = "<group>"; };
22142213
D8FFE50B2703DAAE00607131 /* SwizzlingCallTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwizzlingCallTests.swift; sourceTree = "<group>"; };
2214+
FA034AC72DD3DB4900FE3107 /* SentryIntegrationProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryIntegrationProtocol.h; path = Public/SentryIntegrationProtocol.h; sourceTree = "<group>"; };
22152215
/* End PBXFileReference section */
22162216

22172217
/* Begin PBXFrameworksBuildPhase section */
@@ -2632,6 +2632,7 @@
26322632
D80CD8D52B752FD9002F710B /* SessionReplay */,
26332633
7D7F0A5E23DF3D2C00A4629C /* SentryGlobalEventProcessor.h */,
26342634
7DAC588E23D8B2E0001CF26B /* SentryGlobalEventProcessor.m */,
2635+
FA034AC72DD3DB4900FE3107 /* SentryIntegrationProtocol.h */,
26352636
7BA235622600B61200E12865 /* SentryInternalNotificationNames.h */,
26362637
0A2D8D5C289815EB008720F6 /* SentryBaseIntegration.h */,
26372638
0A2D8D5A289815C0008720F6 /* SentryBaseIntegration.m */,
@@ -4305,7 +4306,6 @@
43054306
620078752D38F1110022CB67 /* Codable */,
43064307
64F9571C2D12DA1800324652 /* SentryViewControllerBreadcrumbTracking.swift */,
43074308
D8F016B22B9622D6007B9AFB /* SentryId.swift */,
4308-
D8CAC0402BA0984500E38F34 /* SentryIntegrationProtocol.swift */,
43094309
D87C89022BC43C9C0086C7DF /* SentryRedactOptions.swift */,
43104310
D8CA12942C203E71005894F4 /* SentrySessionListener.swift */,
43114311
);
@@ -4504,6 +4504,7 @@
45044504
03F84D2327DD414C008FE43F /* SentryThreadHandle.hpp in Headers */,
45054505
7B6C5EE0264E8E050010D138 /* SentryFramesTracker.h in Headers */,
45064506
84A305572BC9EF8C00D84283 /* SentryTraceProfiler.h in Headers */,
4507+
FA034AC82DD3DB4900FE3107 /* SentryIntegrationProtocol.h in Headers */,
45074508
63FE715720DA4C1100CDBAE8 /* SentryCrashThread.h in Headers */,
45084509
7BF9EF862722D10600B5BBEF /* SentryTestObjCRuntimeWrapper.h in Headers */,
45094510
15360CD2243277A000112302 /* SentrySessionTracker.h in Headers */,
@@ -5225,7 +5226,6 @@
52255226
D8BC28C82BFF5EBB0054DA4D /* SentryTouchTracker.swift in Sources */,
52265227
63FE711720DA4C1000CDBAE8 /* SentryCrashStackCursor_Backtrace.c in Sources */,
52275228
63FE70CB20DA4C1000CDBAE8 /* SentryCrashReportFixer.c in Sources */,
5228-
D8CAC0412BA0984500E38F34 /* SentryIntegrationProtocol.swift in Sources */,
52295229
63FE710F20DA4C1000CDBAE8 /* SentryCrashNSErrorUtil.m in Sources */,
52305230
8ECC674925C23A20000E2BF6 /* SentrySpanId.m in Sources */,
52315231
6344DDB51EC309E000D9160D /* SentryCrashReportSink.m in Sources */,

Sources/Sentry/Public/Sentry.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ FOUNDATION_EXPORT const unsigned char SentryVersionString[];
2424
# import <Sentry/SentryGeo.h>
2525
# import <Sentry/SentryHttpStatusCodeRange.h>
2626
# import <Sentry/SentryHub.h>
27+
# import <Sentry/SentryIntegrationProtocol.h>
2728
# import <Sentry/SentryMeasurementUnit.h>
2829
# import <Sentry/SentryMechanism.h>
2930
# import <Sentry/SentryMechanismMeta.h>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#import <Foundation/Foundation.h>
2+
3+
NS_ASSUME_NONNULL_BEGIN
4+
5+
@class SentryOptions;
6+
7+
@protocol SentryIntegrationProtocol <NSObject>
8+
9+
/**
10+
* Installs the integration and returns YES if successful.
11+
*/
12+
- (BOOL)installWithOptions:(SentryOptions *)options NS_SWIFT_NAME(install(with:));
13+
14+
/**
15+
* Uninstalls the integration.
16+
*/
17+
- (void)uninstall;
18+
19+
@end
20+
21+
NS_ASSUME_NONNULL_END

Sources/Sentry/Public/SentryWithoutUIKit.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ FOUNDATION_EXPORT const unsigned char SentryVersionString[];
2525
# import <SentryWithoutUIKit/SentryGeo.h>
2626
# import <SentryWithoutUIKit/SentryHttpStatusCodeRange.h>
2727
# import <SentryWithoutUIKit/SentryHub.h>
28+
# import <SentryWithoutUIKit/SentryIntegrationProtocol.h>
2829
# import <SentryWithoutUIKit/SentryMeasurementUnit.h>
2930
# import <SentryWithoutUIKit/SentryMechanism.h>
3031
# import <SentryWithoutUIKit/SentryMechanismMeta.h>

Sources/Sentry/SentryHub.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#import "SentryFileManager.h"
1010
#import "SentryHub+Private.h"
1111
#import "SentryInstallation.h"
12+
#import "SentryIntegrationProtocol.h"
1213
#import "SentryLevelMapper.h"
1314
#import "SentryLog.h"
1415
#import "SentryNSTimerFactory.h"

Sources/Sentry/SentryViewHierarchyIntegration.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# import "SentryEvent+Private.h"
88
# import "SentryException.h"
99
# import "SentryHub+Private.h"
10+
# import "SentryOptions.h"
1011
# import "SentrySDK+Private.h"
1112
# import "SentryViewHierarchy.h"
1213
# if SENTRY_HAS_METRIC_KIT

Sources/Sentry/include/HybridPublic/SentryBaseIntegration.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#import <Foundation/Foundation.h>
22

3+
#if __has_include(<Sentry/SentryIntegrationProtocol.h>)
4+
# import <Sentry/SentryIntegrationProtocol.h>
5+
#else
6+
# import "SentryIntegrationProtocol.h"
7+
#endif
8+
39
NS_ASSUME_NONNULL_BEGIN
410

511
typedef NS_OPTIONS(NSUInteger, SentryIntegrationOption) {
@@ -28,7 +34,7 @@ typedef NS_OPTIONS(NSUInteger, SentryIntegrationOption) {
2834

2935
@class SentryOptions;
3036

31-
@interface SentryBaseIntegration : NSObject
37+
@interface SentryBaseIntegration : NSObject <SentryIntegrationProtocol>
3238

3339
- (NSString *)integrationName;
3440
- (BOOL)installWithOptions:(SentryOptions *)options;

Sources/Sentry/include/SentryANRTrackingIntegration.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ NS_ASSUME_NONNULL_BEGIN
66

77
static NSString *const SentryANRExceptionType = @"App Hanging";
88

9-
@interface SentryANRTrackingIntegration
10-
: SentryBaseIntegration <SentryIntegrationProtocol, SentryANRTrackerDelegate>
9+
@interface SentryANRTrackingIntegration : SentryBaseIntegration <SentryANRTrackerDelegate>
1110

1211
- (void)pauseAppHangTracking;
1312
- (void)resumeAppHangTracking;

Sources/Sentry/include/SentryAppStartTrackingIntegration.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
#if SENTRY_HAS_UIKIT
44

55
# import "SentryBaseIntegration.h"
6-
# import "SentrySwift.h"
76

87
NS_ASSUME_NONNULL_BEGIN
98

109
/**
1110
* Tracks cold and warm app start time for iOS, tvOS, and Mac Catalyst.
1211
*/
13-
@interface SentryAppStartTrackingIntegration : SentryBaseIntegration <SentryIntegrationProtocol>
12+
@interface SentryAppStartTrackingIntegration : SentryBaseIntegration
1413

1514
- (void)stop;
1615

Sources/Sentry/include/SentryAutoBreadcrumbTrackingIntegration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ NS_ASSUME_NONNULL_BEGIN
88
* This automatically adds breadcrumbs for different user actions.
99
*/
1010
@interface SentryAutoBreadcrumbTrackingIntegration
11-
: SentryBaseIntegration <SentryIntegrationProtocol, SentryBreadcrumbDelegate>
11+
: SentryBaseIntegration <SentryBreadcrumbDelegate>
1212

1313
@end
1414

0 commit comments

Comments
 (0)