Skip to content

Commit b80a09b

Browse files
committed
Sentry SDK objc version
1 parent 062ca20 commit b80a09b

File tree

13 files changed

+278
-19
lines changed

13 files changed

+278
-19
lines changed

Samples/SentrySampleShared/SentrySampleShared/SpanObserver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class SpanObserver: NSObject {
1010
}
1111

1212
convenience init?(callback: @escaping (Span) -> Void) {
13-
guard let span = SentrySDK.span else { return nil }
13+
guard let span = SentrySDKSwift.span else { return nil }
1414
self.init(span: span)
1515
self.performOnFinish(callback: callback)
1616
}

Sentry.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,8 @@
11191119
FAE2DAB82E1F317900262307 /* SentryProfilingSwiftHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = FAE2DAB72E1F317900262307 /* SentryProfilingSwiftHelpers.m */; };
11201120
FAE2DABA2E1F318900262307 /* SentryProfilingSwiftHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE2DAB92E1F318900262307 /* SentryProfilingSwiftHelpers.h */; };
11211121
FAE5798D2E7D9D4C00B710F9 /* SentrySysctl.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAE579872E7D9D4900B710F9 /* SentrySysctl.swift */; };
1122+
FAE57A252E819A8300B710F9 /* SentrySDK.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE57A1F2E819A8000B710F9 /* SentrySDK.h */; settings = {ATTRIBUTES = (Public, ); }; };
1123+
FAE57A272E819ADC00B710F9 /* SentrySDK.m in Sources */ = {isa = PBXBuildFile; fileRef = FAE57A262E819ADA00B710F9 /* SentrySDK.m */; };
11221124
FAE80C242E4695B40010A595 /* SentryEvent+Serialize.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE80C232E4695AE0010A595 /* SentryEvent+Serialize.h */; };
11231125
FAEC270E2DF3526000878871 /* SentryUserFeedback.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEC270D2DF3526000878871 /* SentryUserFeedback.swift */; };
11241126
FAEC273D2DF3933A00878871 /* NSData+Unzip.m in Sources */ = {isa = PBXBuildFile; fileRef = FAEC273C2DF3933200878871 /* NSData+Unzip.m */; };
@@ -2466,6 +2468,8 @@
24662468
FAE2DAB72E1F317900262307 /* SentryProfilingSwiftHelpers.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryProfilingSwiftHelpers.m; sourceTree = "<group>"; };
24672469
FAE2DAB92E1F318900262307 /* SentryProfilingSwiftHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryProfilingSwiftHelpers.h; path = Sources/Sentry/include/SentryProfilingSwiftHelpers.h; sourceTree = SOURCE_ROOT; };
24682470
FAE579872E7D9D4900B710F9 /* SentrySysctl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySysctl.swift; sourceTree = "<group>"; };
2471+
FAE57A1F2E819A8000B710F9 /* SentrySDK.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentrySDK.h; path = Public/SentrySDK.h; sourceTree = "<group>"; };
2472+
FAE57A262E819ADA00B710F9 /* SentrySDK.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySDK.m; sourceTree = "<group>"; };
24692473
FAE80C232E4695AE0010A595 /* SentryEvent+Serialize.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryEvent+Serialize.h"; path = "include/SentryEvent+Serialize.h"; sourceTree = "<group>"; };
24702474
FAEC270D2DF3526000878871 /* SentryUserFeedback.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUserFeedback.swift; sourceTree = "<group>"; };
24712475
FAEC273C2DF3933200878871 /* NSData+Unzip.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSData+Unzip.m"; sourceTree = "<group>"; };
@@ -2900,6 +2904,8 @@
29002904
639889D51EDF10BE00EA7442 /* Helper */ = {
29012905
isa = PBXGroup;
29022906
children = (
2907+
FAE57A1F2E819A8000B710F9 /* SentrySDK.h */,
2908+
FAE57A262E819ADA00B710F9 /* SentrySDK.m */,
29032909
63AA76951EB9C1C200D153DE /* SentryDefines.h */,
29042910
627E7588299F6FE40085504D /* SentryInternalDefines.h */,
29052911
0A9E917028DC7E7000FB4182 /* SentryInternalCDefines.h */,
@@ -4919,6 +4925,7 @@
49194925
8E133FA625E72EB400ABD0BF /* SentrySamplingContext.h in Headers */,
49204926
0A9BF4E428A114B50068D266 /* SentryViewHierarchyIntegration.h in Headers */,
49214927
D8BBD32728FD9FC00011F850 /* SentrySwift.h in Headers */,
4928+
FAE57A252E819A8300B710F9 /* SentrySDK.h in Headers */,
49224929
84CFA4CE2C9E0CA3008DA5F4 /* SentryUserFeedbackIntegration.h in Headers */,
49234930
8482FA9B2DD7C397000E9283 /* SentryFeedbackAPI.h in Headers */,
49244931
8E4E7C7425DAAB49006AB9E2 /* SentrySpanProtocol.h in Headers */,
@@ -5959,6 +5966,7 @@
59595966
63FE710B20DA4C1000CDBAE8 /* SentryCrashMach.c in Sources */,
59605967
63FE707720DA4C1000CDBAE8 /* SentryDictionaryDeepSearch.m in Sources */,
59615968
FACEED132E3179A10007B4AC /* SentyOptionsInternal.m in Sources */,
5969+
FAE57A272E819ADC00B710F9 /* SentrySDK.m in Sources */,
59625970
8482FA9C2DD7C397000E9283 /* SentryFeedbackAPI.m in Sources */,
59635971
7BC9A20628F41781001E7C4C /* SentryMeasurementUnit.m in Sources */,
59645972
63FE71A020DA4C1100CDBAE8 /* SentryCrashInstallation.m in Sources */,

Sources/Sentry/PrivateSentrySDKOnly.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ + (NSString *__nullable)getReplayId
363363
{
364364
__block NSString *__nullable replayId;
365365

366-
[SentrySDK configureScope:^(SentryScope *_Nonnull scope) { replayId = scope.replayId; }];
366+
[SentrySDKSwift configureScope:^(SentryScope *_Nonnull scope) { replayId = scope.replayId; }];
367367

368368
return replayId;
369369
}

Sources/Sentry/Public/Sentry.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ FOUNDATION_EXPORT const unsigned char SentryVersionString[];
3434
# import <Sentry/SentryOptions.h>
3535
# import <Sentry/SentryReplayApi.h>
3636
# import <Sentry/SentryRequest.h>
37+
# import <Sentry/SentrySDK.h>
3738
# import <Sentry/SentrySampleDecision.h>
3839
# import <Sentry/SentrySamplingContext.h>
3940
# import <Sentry/SentryScope.h>

Sources/Sentry/Public/SentryWithoutUIKit.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ FOUNDATION_EXPORT double SentryVersionNumber;
77
//! Project version string for Sentry.
88
FOUNDATION_EXPORT const unsigned char SentryVersionString[];
99

10+
# import <Sentry/SentrySDK.h>
1011
# import <SentryWithoutUIKit/Sentry.h>
1112
# import <SentryWithoutUIKit/SentryAttachment.h>
1213
# import <SentryWithoutUIKit/SentryBaggage.h>

Sources/Sentry/SentryANRTrackingIntegration.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ - (void)anrDetectedWithType:(enum SentryANRType)type
185185
[self.fileManager storeAppHangEvent:event];
186186
} else {
187187
#endif // SENTRY_HAS_UIKIT
188-
[SentrySDK captureEvent:event];
188+
[SentrySDKSwift captureEvent:event];
189189
#if SENTRY_HAS_UIKIT
190190
}
191191
#endif // SENTRY_UIKIT_AVAILABLE
@@ -233,7 +233,7 @@ - (void)anrStoppedWithResult:(SentryANRStoppedResult *_Nullable)result
233233

234234
// We already applied the scope. We use an empty scope to avoid overwriting exising fields on
235235
// the event.
236-
[SentrySDK captureEvent:event withScope:[[SentryScope alloc] init]];
236+
[SentrySDKSwift captureEvent:event withScope:[[SentryScope alloc] init]];
237237
#endif // SENTRY_HAS_UIKIT
238238
}
239239

@@ -257,7 +257,7 @@ - (void)captureStoredAppHangEvent
257257
// The app crashed during an ongoing app hang. Capture the stored app hang as it is.
258258
// We already applied the scope. We use an empty scope to avoid overwriting exising
259259
// fields on the event.
260-
[SentrySDK captureEvent:event withScope:[[SentryScope alloc] init]];
260+
[SentrySDKSwift captureEvent:event withScope:[[SentryScope alloc] init]];
261261
} else {
262262
// Fatal App Hang
263263
// We can't differ if the watchdog or the user terminated the app, because when the main

Sources/Sentry/SentryFileIOTracker.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ + (instancetype _Nullable)sharedInstance
3838
// It is necessary to check if the SDK is enabled because accessing the tracker will otherwise
3939
// initialize the depency container without any configured SDK options. This is a known issue
4040
// and needs to be fixed in general.
41-
if (!SentrySDK.isEnabled) {
41+
if (!SentrySDKSwift.isEnabled) {
4242
return nil;
4343
}
4444
return SentryDependencyContainer.sharedInstance.fileIOTracker;

Sources/Sentry/SentryMetricKitIntegration.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -408,15 +408,15 @@ - (SentryEvent *)createEvent:(SentryMXExceptionParams *)params
408408
- (void)captureEvent:(SentryEvent *)event withDiagnosticJSON:(NSData *)diagnosticJSON
409409
{
410410
if (self.attachDiagnosticAsAttachment) {
411-
[SentrySDK captureEvent:event
412-
withScopeBlock:^(SentryScope *_Nonnull scope) {
413-
SentryAttachment *attachment =
414-
[[SentryAttachment alloc] initWithData:diagnosticJSON
415-
filename:@"MXDiagnosticPayload.json"];
416-
[scope addAttachment:attachment];
417-
}];
411+
[SentrySDKSwift captureEvent:event
412+
withScopeBlock:^(SentryScope *_Nonnull scope) {
413+
SentryAttachment *attachment =
414+
[[SentryAttachment alloc] initWithData:diagnosticJSON
415+
filename:@"MXDiagnosticPayload.json"];
416+
[scope addAttachment:attachment];
417+
}];
418418
} else {
419-
[SentrySDK captureEvent:event];
419+
[SentrySDKSwift captureEvent:event];
420420
}
421421
}
422422

Sources/Sentry/SentryNetworkTracker.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ - (void)captureFailedRequests:(NSURLSessionTask *)sessionTask
475475

476476
event.context = context;
477477

478-
[SentrySDK captureEvent:event];
478+
[SentrySDKSwift captureEvent:event];
479479
}
480480

481481
- (BOOL)containsStatusCode:(NSInteger)statusCode
@@ -544,7 +544,7 @@ - (void)addBreadcrumbForSessionTask:(NSURLSessionTask *)sessionTask
544544
}
545545

546546
breadcrumb.data = breadcrumbData;
547-
[SentrySDK addBreadcrumb:breadcrumb];
547+
[SentrySDKSwift addBreadcrumb:breadcrumb];
548548

549549
objc_setAssociatedObject(sessionTask, &SENTRY_NETWORK_REQUEST_TRACKER_BREADCRUMB,
550550
[NSNumber numberWithBool:YES], OBJC_ASSOCIATION_RETAIN_NONATOMIC);

0 commit comments

Comments
 (0)