diff --git a/Samples/iOS-SwiftUI/iOS-SwiftUI.yml b/Samples/iOS-SwiftUI/iOS-SwiftUI.yml index cc986e2d42d..e8d8c29a78f 100644 --- a/Samples/iOS-SwiftUI/iOS-SwiftUI.yml +++ b/Samples/iOS-SwiftUI/iOS-SwiftUI.yml @@ -27,7 +27,6 @@ targets: sources: - iOS-SwiftUI - ../Shared/SampleAssets.xcassets - - ../../Sources/Sentry/Public/SentrySerializable.h - ../../Sources/Sentry/include/SentryTracer.h - ../../Sources/Sentry/include/SentryPerformanceTracker.h - ../../Sources/Sentry/Public/SentryProfilingConditionals.h diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index 745edaac8d9..00334550ca3 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -148,7 +148,6 @@ 62FC69362BEDFF18002D3EF2 /* SentryLogExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62FC69352BEDFF18002D3EF2 /* SentryLogExtensions.swift */; }; 6304360A1EC0595B00C4D3FA /* SentryNSDataUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 630436081EC0595B00C4D3FA /* SentryNSDataUtils.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6304360B1EC0595B00C4D3FA /* SentryNSDataUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 630436091EC0595B00C4D3FA /* SentryNSDataUtils.m */; }; - 630436101EC0600A00C4D3FA /* SentrySerializable.h in Headers */ = {isa = PBXBuildFile; fileRef = 6304360F1EC0600A00C4D3FA /* SentrySerializable.h */; settings = {ATTRIBUTES = (Public, ); }; }; 630436161EC0AD3100C4D3FA /* SentryNSDataCompressionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 630436151EC0AD3100C4D3FA /* SentryNSDataCompressionTests.m */; }; 630C01941EC3402C00C52CEF /* SentryCrashReportConverterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 630C01931EC3402C00C52CEF /* SentryCrashReportConverterTests.m */; }; 630C01961EC341D600C52CEF /* Resources in Resources */ = {isa = PBXBuildFile; fileRef = 630C01951EC341D600C52CEF /* Resources */; }; @@ -1037,7 +1036,7 @@ FA34C1A32E692A5000BC52AA /* SentryEnvelopeItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA34C1A22E692A5000BC52AA /* SentryEnvelopeItem.swift */; }; FA3734842E0F086C0091EF24 /* SentryDependencyContainerSwiftHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = FA3734832E0F07A20091EF24 /* SentryDependencyContainerSwiftHelper.h */; }; FA3734862E0F09320091EF24 /* SentryDependencyContainerSwiftHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = FA3734852E0F092F0091EF24 /* SentryDependencyContainerSwiftHelper.m */; }; - FA3854362E267DA60045A563 /* SentryUser+Serialize.h in Headers */ = {isa = PBXBuildFile; fileRef = FA3854352E267DA20045A563 /* SentryUser+Serialize.h */; }; + FA3854362E267DA60045A563 /* SentryPublicSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = FA3854352E267DA20045A563 /* SentryPublicSerializer.h */; }; FA3A42722E1C5F9B00A08C39 /* SentryNSNotificationCenterWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA3A42712E1C5F9B00A08C39 /* SentryNSNotificationCenterWrapper.swift */; }; FA3AEE782E68E2830092283E /* SentryEnvelopeHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA3AEE772E68E2830092283E /* SentryEnvelopeHeader.swift */; }; FA458CC32E691A730061B13D /* SentryProcessInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA458CBD2E691A6E0061B13D /* SentryProcessInfo.swift */; }; @@ -1128,6 +1127,7 @@ FAC62B652E15A4100003909D /* SentrySDKThreadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAC62B642E15A40C0003909D /* SentrySDKThreadTests.swift */; }; FAC735232E25AA81006C5A64 /* SentryProfilingSwiftHelpersTests.m in Sources */ = {isa = PBXBuildFile; fileRef = FAC735222E25AA7A006C5A64 /* SentryProfilingSwiftHelpersTests.m */; }; FACEED132E3179A10007B4AC /* SentyOptionsInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = FACEED122E3179A10007B4AC /* SentyOptionsInternal.m */; }; + FADF16972EABBC8600D7B458 /* SentryPublicSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = FADF16962EABBC8600D7B458 /* SentryPublicSerializer.m */; }; FAE2DAB82E1F317900262307 /* SentryProfilingSwiftHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = FAE2DAB72E1F317900262307 /* SentryProfilingSwiftHelpers.m */; }; FAE2DABA2E1F318900262307 /* SentryProfilingSwiftHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE2DAB92E1F318900262307 /* SentryProfilingSwiftHelpers.h */; }; FAE579842E7CF21800B710F9 /* SentryMigrateSessionInit.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAE5797E2E7CF21300B710F9 /* SentryMigrateSessionInit.swift */; }; @@ -1137,7 +1137,6 @@ FAE579CC2E7DE14900B710F9 /* SentryFrameRemover.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAE579C62E7DE14400B710F9 /* SentryFrameRemover.swift */; }; FAE57BF72E83049E00B710F9 /* SentryDisplayLinkWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAE57BF12E83049900B710F9 /* SentryDisplayLinkWrapper.swift */; }; FAE57C082E83092E00B710F9 /* SentryDispatchFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAE57C072E83092A00B710F9 /* SentryDispatchFactory.swift */; }; - FAE80C242E4695B40010A595 /* SentryEvent+Serialize.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE80C232E4695AE0010A595 /* SentryEvent+Serialize.h */; }; FAEC273D2DF3933A00878871 /* NSData+Unzip.m in Sources */ = {isa = PBXBuildFile; fileRef = FAEC273C2DF3933200878871 /* NSData+Unzip.m */; }; FAEEBFE22E736D4B00E79CA9 /* SentryViewHierarchyProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEEBFDC2E736D4100E79CA9 /* SentryViewHierarchyProvider.swift */; }; FAEEBFEA2E74517B00E79CA9 /* SentryFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEEBFE92E74517800E79CA9 /* SentryFileManager.swift */; }; @@ -1428,7 +1427,6 @@ 630436081EC0595B00C4D3FA /* SentryNSDataUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryNSDataUtils.h; path = include/SentryNSDataUtils.h; sourceTree = ""; }; 630436091EC0595B00C4D3FA /* SentryNSDataUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SentryNSDataUtils.m; sourceTree = ""; }; 6304360D1EC05CEF00C4D3FA /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; }; - 6304360F1EC0600A00C4D3FA /* SentrySerializable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentrySerializable.h; path = Public/SentrySerializable.h; sourceTree = ""; }; 630436151EC0AD3100C4D3FA /* SentryNSDataCompressionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SentryNSDataCompressionTests.m; sourceTree = ""; }; 630C01931EC3402C00C52CEF /* SentryCrashReportConverterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SentryCrashReportConverterTests.m; sourceTree = ""; }; 630C01951EC341D600C52CEF /* Resources */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Resources; sourceTree = ""; }; @@ -2417,7 +2415,7 @@ FA34C1A22E692A5000BC52AA /* SentryEnvelopeItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryEnvelopeItem.swift; sourceTree = ""; }; FA3734832E0F07A20091EF24 /* SentryDependencyContainerSwiftHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDependencyContainerSwiftHelper.h; path = include/SentryDependencyContainerSwiftHelper.h; sourceTree = ""; }; FA3734852E0F092F0091EF24 /* SentryDependencyContainerSwiftHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDependencyContainerSwiftHelper.m; sourceTree = ""; }; - FA3854352E267DA20045A563 /* SentryUser+Serialize.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryUser+Serialize.h"; path = "include/SentryUser+Serialize.h"; sourceTree = ""; }; + FA3854352E267DA20045A563 /* SentryPublicSerializer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryPublicSerializer.h; path = include/SentryPublicSerializer.h; sourceTree = ""; }; FA3A42712E1C5F9B00A08C39 /* SentryNSNotificationCenterWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryNSNotificationCenterWrapper.swift; sourceTree = ""; }; FA3AEE772E68E2830092283E /* SentryEnvelopeHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryEnvelopeHeader.swift; sourceTree = ""; }; FA458CBD2E691A6E0061B13D /* SentryProcessInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryProcessInfo.swift; sourceTree = ""; }; @@ -2509,6 +2507,7 @@ FAC62B642E15A40C0003909D /* SentrySDKThreadTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySDKThreadTests.swift; sourceTree = ""; }; FAC735222E25AA7A006C5A64 /* SentryProfilingSwiftHelpersTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryProfilingSwiftHelpersTests.m; sourceTree = ""; }; FACEED122E3179A10007B4AC /* SentyOptionsInternal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentyOptionsInternal.m; sourceTree = ""; }; + FADF16962EABBC8600D7B458 /* SentryPublicSerializer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryPublicSerializer.m; sourceTree = ""; }; FAE2DAB72E1F317900262307 /* SentryProfilingSwiftHelpers.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryProfilingSwiftHelpers.m; sourceTree = ""; }; FAE2DAB92E1F318900262307 /* SentryProfilingSwiftHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryProfilingSwiftHelpers.h; path = Sources/Sentry/include/SentryProfilingSwiftHelpers.h; sourceTree = SOURCE_ROOT; }; FAE5797E2E7CF21300B710F9 /* SentryMigrateSessionInit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryMigrateSessionInit.swift; sourceTree = ""; }; @@ -2518,7 +2517,6 @@ FAE579C62E7DE14400B710F9 /* SentryFrameRemover.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryFrameRemover.swift; sourceTree = ""; }; FAE57BF12E83049900B710F9 /* SentryDisplayLinkWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryDisplayLinkWrapper.swift; sourceTree = ""; }; FAE57C072E83092A00B710F9 /* SentryDispatchFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryDispatchFactory.swift; sourceTree = ""; }; - FAE80C232E4695AE0010A595 /* SentryEvent+Serialize.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryEvent+Serialize.h"; path = "include/SentryEvent+Serialize.h"; sourceTree = ""; }; FAEC273C2DF3933200878871 /* NSData+Unzip.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSData+Unzip.m"; sourceTree = ""; }; FAEC273E2DF393E000878871 /* NSData+Unzip.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSData+Unzip.h"; sourceTree = ""; }; FAEEBFDC2E736D4100E79CA9 /* SentryViewHierarchyProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryViewHierarchyProvider.swift; sourceTree = ""; }; @@ -2756,12 +2754,10 @@ D8CB741A2947286500A5F964 /* SentryEnvelopeItemHeader.m */, D8CB74142947246600A5F964 /* SentryEnvelopeAttachmentHeader.h */, D8CB7416294724CC00A5F964 /* SentryEnvelopeAttachmentHeader.m */, - 6304360F1EC0600A00C4D3FA /* SentrySerializable.h */, 6271ADF22BA06D9B0098D2E9 /* SentryInternalSerializable.h */, 639FCF961EBC7B9700778193 /* SentryEvent.h */, 639FCF971EBC7B9700778193 /* SentryEvent.m */, D880E3B02860A5A0008A90DB /* SentryEvent+Private.h */, - FAE80C232E4695AE0010A595 /* SentryEvent+Serialize.h */, 639FCF9E1EBC804600778193 /* SentryException.h */, 639FCF9F1EBC804600778193 /* SentryException.m */, 6334313F20AD9AE40077E581 /* SentryMechanism.h */, @@ -2781,7 +2777,8 @@ 843FB3212D0CD04D00558F18 /* SentryUserAccess.h */, 843FB3222D0CD04D00558F18 /* SentryUserAccess.m */, 92F6726A29C8B7B000BFD34D /* SentryUser+Private.h */, - FA3854352E267DA20045A563 /* SentryUser+Serialize.h */, + FA3854352E267DA20045A563 /* SentryPublicSerializer.h */, + FADF16962EABBC8600D7B458 /* SentryPublicSerializer.m */, 9286059429A5096600F96038 /* SentryGeo.h */, 9286059629A5098900F96038 /* SentryGeo.m */, 63B818F71EC34639002FDF4C /* SentryDebugMeta.h */, @@ -5095,7 +5092,7 @@ 7BAF3DD92440AEC8008A5414 /* SentryRequestManager.h in Headers */, 62862B1C2B1DDBC8009B16E3 /* SentryDelayedFrame.h in Headers */, 627E7589299F6FE40085504D /* SentryInternalDefines.h in Headers */, - FA3854362E267DA60045A563 /* SentryUser+Serialize.h in Headers */, + FA3854362E267DA60045A563 /* SentryPublicSerializer.h in Headers */, 7D0637032382B34300B30749 /* SentryScope.h in Headers */, 03F84D2727DD414C008FE43F /* SentryMachLogging.hpp in Headers */, 63295AF51EF3C7DB002D4490 /* SentryNSDictionarySanitize.h in Headers */, @@ -5128,7 +5125,6 @@ 635B3F381EBC6E2500A6176D /* SentryAsynchronousOperation.h in Headers */, 844EDC76294144DB00C86F34 /* SentrySystemWrapper.h in Headers */, 7B3B473025D6CBFC00D01640 /* SentryNSError.h in Headers */, - 630436101EC0600A00C4D3FA /* SentrySerializable.h in Headers */, 63FE70DD20DA4C1000CDBAE8 /* SentryCrashMonitor_Signal.h in Headers */, 63FE710320DA4C1000CDBAE8 /* SentryCrashMachineContext_Apple.h in Headers */, D8479328278873A100BE8E99 /* SentryByteCountFormatter.h in Headers */, @@ -5212,7 +5208,6 @@ 7B96572026830C9100C66E25 /* SentryScopeSyncC.h in Headers */, 63FE70EB20DA4C1000CDBAE8 /* SentryCrashMonitor_MachException.h in Headers */, D456B4362D706BF2007068CB /* SentryTraceOrigin.h in Headers */, - FAE80C242E4695B40010A595 /* SentryEvent+Serialize.h in Headers */, 7BD86ECF264A7C77005439DB /* SentryAppStartMeasurement.h in Headers */, 0354A22B2A134D9C003C3A04 /* SentryProfilerState.h in Headers */, 7DC8310A2398283C0043DD9A /* SentryCrashIntegration.h in Headers */, @@ -5702,6 +5697,7 @@ FAAB2F972E4D345800FE8B7E /* SentryUIDeviceWrapper.swift in Sources */, D84F833E2A1CC401005828E0 /* SentrySwiftAsyncIntegration.m in Sources */, 7B6438AB26A70F24000D0F65 /* UIViewController+Sentry.m in Sources */, + FADF16972EABBC8600D7B458 /* SentryPublicSerializer.m in Sources */, 84302A812B5767A50027A629 /* SentryLaunchProfiling.m in Sources */, 63AA76A31EB9CBAA00D153DE /* SentryDsn.m in Sources */, D490648A2DFAE1F600555785 /* SentryScreenshotOptions.swift in Sources */, diff --git a/Sources/Sentry/Public/Sentry.h b/Sources/Sentry/Public/Sentry.h index 905baf336d3..fd7a9b6c0e4 100644 --- a/Sources/Sentry/Public/Sentry.h +++ b/Sources/Sentry/Public/Sentry.h @@ -36,7 +36,6 @@ FOUNDATION_EXPORT const unsigned char SentryVersionString[]; # import # import # import -# import # import # import # import diff --git a/Sources/Sentry/Public/SentryBreadcrumb.h b/Sources/Sentry/Public/SentryBreadcrumb.h index 15c56dceb78..824f5b65b5d 100644 --- a/Sources/Sentry/Public/SentryBreadcrumb.h +++ b/Sources/Sentry/Public/SentryBreadcrumb.h @@ -6,17 +6,11 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif NS_ASSUME_NONNULL_BEGIN NS_SWIFT_NAME(Breadcrumb) @interface SentryBreadcrumb : NSObject -#if !SDK_V9 - -#endif /** * Level of breadcrumb diff --git a/Sources/Sentry/Public/SentryDebugMeta.h b/Sources/Sentry/Public/SentryDebugMeta.h index b92e3981058..168ddbdf53b 100644 --- a/Sources/Sentry/Public/SentryDebugMeta.h +++ b/Sources/Sentry/Public/SentryDebugMeta.h @@ -6,9 +6,6 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif NS_ASSUME_NONNULL_BEGIN @@ -23,9 +20,6 @@ NS_ASSUME_NONNULL_BEGIN */ NS_SWIFT_NAME(DebugMeta) @interface SentryDebugMeta : NSObject -#if !SDK_V9 - -#endif /** * Identifier of the dynamic library or executable. It is the value of the @c LC_UUID load command diff --git a/Sources/Sentry/Public/SentryEnvelopeItemHeader.h b/Sources/Sentry/Public/SentryEnvelopeItemHeader.h index df005de67e9..8caa7464e3e 100644 --- a/Sources/Sentry/Public/SentryEnvelopeItemHeader.h +++ b/Sources/Sentry/Public/SentryEnvelopeItemHeader.h @@ -5,16 +5,10 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif NS_ASSUME_NONNULL_BEGIN @interface SentryEnvelopeItemHeader : NSObject -#if !SDK_V9 - -#endif SENTRY_NO_INIT diff --git a/Sources/Sentry/Public/SentryEvent.h b/Sources/Sentry/Public/SentryEvent.h index bf414da793a..56d76f1bd69 100644 --- a/Sources/Sentry/Public/SentryEvent.h +++ b/Sources/Sentry/Public/SentryEvent.h @@ -6,9 +6,6 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif // !SDK_V9 NS_ASSUME_NONNULL_BEGIN @@ -25,9 +22,6 @@ NS_ASSUME_NONNULL_BEGIN NS_SWIFT_NAME(Event) @interface SentryEvent : NSObject -#if !SDK_V9 - -#endif // !SDK_V9 /** * This will be set by the initializer. diff --git a/Sources/Sentry/Public/SentryException.h b/Sources/Sentry/Public/SentryException.h index 5bd903ca634..9643ab59877 100644 --- a/Sources/Sentry/Public/SentryException.h +++ b/Sources/Sentry/Public/SentryException.h @@ -6,9 +6,6 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif NS_ASSUME_NONNULL_BEGIN @@ -17,9 +14,6 @@ NS_ASSUME_NONNULL_BEGIN NS_SWIFT_NAME(Exception) @interface SentryException : NSObject -#if !SDK_V9 - -#endif SENTRY_NO_INIT diff --git a/Sources/Sentry/Public/SentryFrame.h b/Sources/Sentry/Public/SentryFrame.h index c459239bbd8..6128e3ce0ee 100644 --- a/Sources/Sentry/Public/SentryFrame.h +++ b/Sources/Sentry/Public/SentryFrame.h @@ -6,17 +6,11 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif NS_ASSUME_NONNULL_BEGIN NS_SWIFT_NAME(Frame) @interface SentryFrame : NSObject -#if !SDK_V9 - -#endif /** * SymbolAddress of the frame diff --git a/Sources/Sentry/Public/SentryGeo.h b/Sources/Sentry/Public/SentryGeo.h index 88fd24188a7..f35c296a89c 100644 --- a/Sources/Sentry/Public/SentryGeo.h +++ b/Sources/Sentry/Public/SentryGeo.h @@ -6,9 +6,6 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif NS_ASSUME_NONNULL_BEGIN @@ -24,11 +21,7 @@ NS_ASSUME_NONNULL_BEGIN /// } NS_SWIFT_NAME(Geo) @interface SentryGeo : NSObject -#if !SDK_V9 - -#else -#endif /** * Optional: Human readable city name. diff --git a/Sources/Sentry/Public/SentryMechanism.h b/Sources/Sentry/Public/SentryMechanism.h index 68643c0c177..8a2eeb4d23c 100644 --- a/Sources/Sentry/Public/SentryMechanism.h +++ b/Sources/Sentry/Public/SentryMechanism.h @@ -6,9 +6,6 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif NS_ASSUME_NONNULL_BEGIN @@ -17,9 +14,6 @@ NS_ASSUME_NONNULL_BEGIN NS_SWIFT_NAME(Mechanism) @interface SentryMechanism : NSObject -#if !SDK_V9 - -#endif SENTRY_NO_INIT diff --git a/Sources/Sentry/Public/SentryMechanismMeta.h b/Sources/Sentry/Public/SentryMechanismMeta.h index 3b57a21f512..061a003e238 100644 --- a/Sources/Sentry/Public/SentryMechanismMeta.h +++ b/Sources/Sentry/Public/SentryMechanismMeta.h @@ -6,9 +6,6 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif @class SentryNSError; @@ -21,9 +18,6 @@ NS_ASSUME_NONNULL_BEGIN */ NS_SWIFT_NAME(MechanismMeta) @interface SentryMechanismMeta : NSObject -#if !SDK_V9 - -#endif - (instancetype)init; diff --git a/Sources/Sentry/Public/SentryMessage.h b/Sources/Sentry/Public/SentryMessage.h index c704d28fb29..b728bb8e850 100644 --- a/Sources/Sentry/Public/SentryMessage.h +++ b/Sources/Sentry/Public/SentryMessage.h @@ -6,9 +6,6 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif NS_ASSUME_NONNULL_BEGIN @@ -18,9 +15,6 @@ NS_ASSUME_NONNULL_BEGIN * @see https://develop.sentry.dev/sdk/event-payloads/message/ */ @interface SentryMessage : NSObject -#if !SDK_V9 - -#endif SENTRY_NO_INIT diff --git a/Sources/Sentry/Public/SentryNSError.h b/Sources/Sentry/Public/SentryNSError.h index 40620c31d56..ac3872569c0 100644 --- a/Sources/Sentry/Public/SentryNSError.h +++ b/Sources/Sentry/Public/SentryNSError.h @@ -6,9 +6,6 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif NS_ASSUME_NONNULL_BEGIN @@ -16,9 +13,6 @@ NS_ASSUME_NONNULL_BEGIN * Sentry representation of an @c NSError to send to Sentry. */ @interface SentryNSError : NSObject -#if !SDK_V9 - -#endif SENTRY_NO_INIT diff --git a/Sources/Sentry/Public/SentryRequest.h b/Sources/Sentry/Public/SentryRequest.h index dcbcea3ceb3..c09797912dd 100644 --- a/Sources/Sentry/Public/SentryRequest.h +++ b/Sources/Sentry/Public/SentryRequest.h @@ -5,16 +5,10 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif NS_ASSUME_NONNULL_BEGIN @interface SentryRequest : NSObject -#if !SDK_V9 - -#endif /** * Optional: HTTP response body size. diff --git a/Sources/Sentry/Public/SentryScope.h b/Sources/Sentry/Public/SentryScope.h index 907c6e06100..4aba3a9bbcf 100644 --- a/Sources/Sentry/Public/SentryScope.h +++ b/Sources/Sentry/Public/SentryScope.h @@ -5,9 +5,6 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif // SDK_V9 #import SENTRY_HEADER(SentrySpanProtocol) @class SentryAttachment; @@ -25,9 +22,6 @@ NS_ASSUME_NONNULL_BEGIN */ NS_SWIFT_NAME(Scope) @interface SentryScope : NSObject -#if !SDK_V9 - -#endif // !SDK_V9 /** * Returns current Span or Transaction. diff --git a/Sources/Sentry/Public/SentrySerializable.h b/Sources/Sentry/Public/SentrySerializable.h deleted file mode 100644 index 974358882be..00000000000 --- a/Sources/Sentry/Public/SentrySerializable.h +++ /dev/null @@ -1,23 +0,0 @@ -#import -#if __has_include() -# import -#elif __has_include() -# import -#else -# import -#endif - -NS_ASSUME_NONNULL_BEGIN - -@protocol SentrySerializable -SENTRY_NO_INIT - -/** - * Serialize the contents of the object into an NSDictionary. Make to copy all properties of the - * original object so modifications to it don't have an impact on the serialized NSDictionary. - */ -- (NSDictionary *)serialize; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Sources/Sentry/Public/SentrySpanContext.h b/Sources/Sentry/Public/SentrySpanContext.h index 89c7fd3575a..a04ab995317 100644 --- a/Sources/Sentry/Public/SentrySpanContext.h +++ b/Sources/Sentry/Public/SentrySpanContext.h @@ -6,9 +6,6 @@ # import #endif #import SENTRY_HEADER(SentrySampleDecision) -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif #import SENTRY_HEADER(SentrySpanStatus) NS_ASSUME_NONNULL_BEGIN @@ -20,9 +17,6 @@ static NSString const *SENTRY_TRACE_TYPE = @"trace"; NS_SWIFT_NAME(SpanContext) @interface SentrySpanContext : NSObject -#if !SDK_V9 - -#endif SENTRY_NO_INIT diff --git a/Sources/Sentry/Public/SentrySpanProtocol.h b/Sources/Sentry/Public/SentrySpanProtocol.h index cb41d2dbd3b..dac90d3a3a8 100644 --- a/Sources/Sentry/Public/SentrySpanProtocol.h +++ b/Sources/Sentry/Public/SentrySpanProtocol.h @@ -5,9 +5,6 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif // SDK_V9 #import SENTRY_HEADER(SentrySpanContext) NS_ASSUME_NONNULL_BEGIN @@ -19,11 +16,7 @@ NS_ASSUME_NONNULL_BEGIN @class SentryTraceHeader; NS_SWIFT_NAME(Span) -#if SDK_V9 @protocol SentrySpan -#else -@protocol SentrySpan -#endif /** * Determines which trace the Span belongs to. diff --git a/Sources/Sentry/Public/SentryStacktrace.h b/Sources/Sentry/Public/SentryStacktrace.h index 0f6b5d4695c..100d0c4eefa 100644 --- a/Sources/Sentry/Public/SentryStacktrace.h +++ b/Sources/Sentry/Public/SentryStacktrace.h @@ -6,18 +6,12 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif NS_ASSUME_NONNULL_BEGIN @class SentryFrame; @interface SentryStacktrace : NSObject -#if !SDK_V9 - -#endif SENTRY_NO_INIT diff --git a/Sources/Sentry/Public/SentryThread.h b/Sources/Sentry/Public/SentryThread.h index b17b687f1fd..e219e5c0307 100644 --- a/Sources/Sentry/Public/SentryThread.h +++ b/Sources/Sentry/Public/SentryThread.h @@ -5,18 +5,12 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif NS_ASSUME_NONNULL_BEGIN @class SentryStacktrace; @interface SentryThread : NSObject -#if !SDK_V9 - -#endif SENTRY_NO_INIT diff --git a/Sources/Sentry/Public/SentryTraceContext.h b/Sources/Sentry/Public/SentryTraceContext.h index 7e91bb2e448..7d6e5543d6d 100644 --- a/Sources/Sentry/Public/SentryTraceContext.h +++ b/Sources/Sentry/Public/SentryTraceContext.h @@ -5,9 +5,6 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif NS_ASSUME_NONNULL_BEGIN @@ -20,9 +17,6 @@ NS_ASSUME_NONNULL_BEGIN NS_SWIFT_NAME(TraceContext) @interface SentryTraceContext : NSObject -#if !SDK_V9 - -#endif /** * UUID V4 encoded as a hexadecimal sequence with no dashes (e.g. 771a43a4192642f0b136d5159a501700) diff --git a/Sources/Sentry/Public/SentryUser.h b/Sources/Sentry/Public/SentryUser.h index e317550c8c6..c301308b854 100644 --- a/Sources/Sentry/Public/SentryUser.h +++ b/Sources/Sentry/Public/SentryUser.h @@ -5,9 +5,6 @@ #else # import #endif -#if !SDK_V9 -# import SENTRY_HEADER(SentrySerializable) -#endif // !SDK_V9 NS_ASSUME_NONNULL_BEGIN @@ -15,11 +12,7 @@ NS_ASSUME_NONNULL_BEGIN NS_SWIFT_NAME(User) @interface SentryUser : NSObject -#if SDK_V9 -#else - -#endif // SDK_V9 /** * Optional: Id of the user diff --git a/Sources/Sentry/Public/SentryWithoutUIKit.h b/Sources/Sentry/Public/SentryWithoutUIKit.h index 1b9597110a7..958683e8f7d 100644 --- a/Sources/Sentry/Public/SentryWithoutUIKit.h +++ b/Sources/Sentry/Public/SentryWithoutUIKit.h @@ -37,7 +37,6 @@ FOUNDATION_EXPORT const unsigned char SentryVersionString[]; # import # import # import -# import # import # import # import diff --git a/Sources/Sentry/SentryCrashScopeObserver.m b/Sources/Sentry/SentryCrashScopeObserver.m index e17272551d9..04a91edbe69 100644 --- a/Sources/Sentry/SentryCrashScopeObserver.m +++ b/Sources/Sentry/SentryCrashScopeObserver.m @@ -1,6 +1,6 @@ #import "SentryLevelMapper.h" #import "SentrySwift.h" -#import "SentryUser+Serialize.h" +#import "SentryPublicSerializer.h" #import #import #import @@ -24,7 +24,14 @@ - (instancetype)initWithMaxBreadcrumbs:(NSInteger)maxBreadcrumbs - (void)setUser:(nullable SentryUser *)user { [self syncScope:user - serialize:^{ return [user serialize]; } + serialize:^{ + if (user) + { + return (NSDictionary * _Nullable) [SentryPublicSerializer serializeUser:(SentryUser *) user]; + } else { + return (NSDictionary * _Nonnull) nil; + } + } syncToSentryCrash:^(const void *bytes) { sentrycrash_scopesync_setUser(bytes); }]; } diff --git a/Sources/Sentry/SentryEvent.m b/Sources/Sentry/SentryEvent.m index 501f428798d..8d4654c7203 100644 --- a/Sources/Sentry/SentryEvent.m +++ b/Sources/Sentry/SentryEvent.m @@ -14,7 +14,7 @@ #import "SentryStacktrace.h" #import "SentrySwift.h" #import "SentryThread.h" -#import "SentryUser+Serialize.h" +#import "SentryPublicSerializer.h" #import "SentryUser.h" #if SENTRY_HAS_METRIC_KIT @@ -59,7 +59,7 @@ - (instancetype)initWithError:(NSError *)error return self; } -- (NSDictionary *)serialize +- (NSDictionary *)serializeBaseEvent { if (nil == self.timestamp) { self.timestamp = [SentryDependencyContainer.sharedInstance.dateProvider date]; diff --git a/Sources/Sentry/SentryFileManagerHelper.m b/Sources/Sentry/SentryFileManagerHelper.m index 6b3b7bdae9f..77f5f4c51c2 100644 --- a/Sources/Sentry/SentryFileManagerHelper.m +++ b/Sources/Sentry/SentryFileManagerHelper.m @@ -4,11 +4,12 @@ #import "SentryDsn.h" #import "SentryEnvelopeItemHeader.h" #import "SentryError.h" -#import "SentryEvent+Serialize.h" +#import "SentryEvent+Private.h" #import "SentryEvent.h" #import "SentryInternalDefines.h" #import "SentryLogC.h" #import "SentryOptions.h" +#import "SentryModels+Serializable.h" #import "SentrySerialization.h" #import "SentrySwift.h" @@ -518,7 +519,7 @@ - (void)deleteTimezoneOffset - (void)storeAppHangEvent:(SentryEvent *)appHangEvent { - NSData *jsonData = [SentrySerializationSwift dataWithJSONObject:[appHangEvent serialize]]; + NSData *jsonData = [SentrySerializationSwift dataWithJSONObject:[appHangEvent serializeBaseEvent]]; if (jsonData == nil) { SENTRY_LOG_ERROR(@"Failed to store app hang event, because of an error in serialization."); return; diff --git a/Sources/Sentry/SentryPublicSerializer.m b/Sources/Sentry/SentryPublicSerializer.m new file mode 100644 index 00000000000..051b0bea505 --- /dev/null +++ b/Sources/Sentry/SentryPublicSerializer.m @@ -0,0 +1,22 @@ +#import "SentryPublicSerializer.h" +#import "SentryModels+Serializable.h" + +@implementation SentryPublicSerializer + ++ (NSDictionary *)serializeUser:(SentryUser *)user { + return [user serialize]; +} + ++ (NSDictionary *)serializeTraceContext:(SentryTraceContext *)traceContext { + return [traceContext serialize]; +} + ++ (NSDictionary *)serializeEnvelopeHeader:(SentryEnvelopeItemHeader *)header { + return [header serialize]; +} + ++ (NSDictionary *)serializeEvent:(SentryEvent *)event { + return [event serializeBaseEvent]; +} + +@end diff --git a/Sources/Sentry/SentryScope.m b/Sources/Sentry/SentryScope.m index 67d3283d50d..e5ebefbad2b 100644 --- a/Sources/Sentry/SentryScope.m +++ b/Sources/Sentry/SentryScope.m @@ -14,7 +14,7 @@ #import "SentrySwift.h" #import "SentryTracer.h" #import "SentryTransactionContext.h" -#import "SentryUser+Serialize.h" +#import "SentryPublicSerializer.h" #import "SentryUser.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Sources/Sentry/SentryTransaction.m b/Sources/Sentry/SentryTransaction.m index e7ab40b13b2..c09d1bc9f2e 100644 --- a/Sources/Sentry/SentryTransaction.m +++ b/Sources/Sentry/SentryTransaction.m @@ -1,10 +1,11 @@ #import "SentryTransaction.h" -#import "SentryEvent+Serialize.h" +#import "SentryEvent+Private.h" #import "SentryInternalDefines.h" #import "SentryNSDictionarySanitize.h" #import "SentryProfilingConditionals.h" #import "SentrySpan+Private.h" #import "SentrySwift.h" +#import "SentryPublicSerializer.h" #import "SentryTransactionContext.h" NS_ASSUME_NONNULL_BEGIN @@ -26,7 +27,7 @@ - (instancetype)initWithTrace:(SentryTracer *)trace children:(NSArray *)serialize { NSMutableDictionary *serializedData = - [[NSMutableDictionary alloc] initWithDictionary:[super serialize]]; + [[NSMutableDictionary alloc] initWithDictionary:[SentryPublicSerializer serializeEvent:self]]; NSMutableArray *serializedSpans = [[NSMutableArray alloc] init]; for (id span in self.spans) { diff --git a/Sources/Sentry/include/SentryEvent+Private.h b/Sources/Sentry/include/SentryEvent+Private.h index 93ccff9d432..77318b88d96 100644 --- a/Sources/Sentry/include/SentryEvent+Private.h +++ b/Sources/Sentry/include/SentryEvent+Private.h @@ -3,6 +3,8 @@ #import "SentryProfilingConditionals.h" #import +NS_ASSUME_NONNULL_BEGIN + @interface SentryEvent () /** @@ -36,3 +38,5 @@ #endif // SENTRY_HAS_METRIC_KIT @end + +NS_ASSUME_NONNULL_END diff --git a/Sources/Sentry/include/SentryEvent+Serialize.h b/Sources/Sentry/include/SentryEvent+Serialize.h deleted file mode 100644 index c5adca2fa13..00000000000 --- a/Sources/Sentry/include/SentryEvent+Serialize.h +++ /dev/null @@ -1,8 +0,0 @@ -#if SDK_V9 -# import "SentryEvent.h" -# import "SentrySerializable.h" - -@interface SentryEvent () - -@end -#endif // SDK_V9 diff --git a/Sources/Sentry/include/SentryModels+Serializable.h b/Sources/Sentry/include/SentryModels+Serializable.h index 4d584e2fd6e..fe9b219f08d 100644 --- a/Sources/Sentry/include/SentryModels+Serializable.h +++ b/Sources/Sentry/include/SentryModels+Serializable.h @@ -1,4 +1,3 @@ -#if SDK_V9 # import "SentryBreadcrumb.h" # import "SentryDebugMeta.h" # import "SentryEnvelopeItemHeader.h" @@ -24,11 +23,15 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface SentryUser () +// Since SentryEvent has Swift classes inherit from it, it needs a base +// function with a unique name +@interface SentryEvent () + +- (NSDictionary *)serializeBaseEvent; @end -@interface SentryEvent () +@interface SentryUser () @end @@ -58,8 +61,6 @@ NS_ASSUME_NONNULL_BEGIN @interface SentryEnvelopeItemHeader () -- (NSDictionary *)serialize; - @end @interface SentryFrame () @@ -76,8 +77,6 @@ NS_ASSUME_NONNULL_BEGIN @interface SentryTraceContext () -- (NSDictionary *)serialize; - @end @interface SentryMessage () @@ -97,5 +96,3 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END - -#endif // SDK_V9 diff --git a/Sources/Sentry/include/SentryPrivate.h b/Sources/Sentry/include/SentryPrivate.h index 93ae7fb6acf..451910e44b5 100644 --- a/Sources/Sentry/include/SentryPrivate.h +++ b/Sources/Sentry/include/SentryPrivate.h @@ -41,12 +41,10 @@ #import "SentryDelayedFramesTracker.h" #import "SentryDependencyContainerSwiftHelper.h" #import "SentryDeviceContextKeys.h" -#import "SentryEvent+Serialize.h" #import "SentryFileIOTrackerHelper.h" #import "SentryFileManagerHelper.h" #import "SentryLevelHelper.h" #import "SentryMeta.h" -#import "SentryModels+Serializable.h" #import "SentryMsgPackSerializer.h" #import "SentryNSDictionarySanitize.h" #import "SentryOptions+Private.h" @@ -64,5 +62,5 @@ #import "SentryTraceHeader.h" #import "SentryTraceOrigin.h" #import "SentryTraceProfiler.h" -#import "SentryUser+Serialize.h" +#import "SentryPublicSerializer.h" #import "SentryWatchdogTerminationBreadcrumbProcessor.h" diff --git a/Sources/Sentry/include/SentryPublicSerializer.h b/Sources/Sentry/include/SentryPublicSerializer.h new file mode 100644 index 00000000000..ba6f39bb103 --- /dev/null +++ b/Sources/Sentry/include/SentryPublicSerializer.h @@ -0,0 +1,22 @@ +#import + +@class SentryUser; +@class SentryEvent; +@class SentryTraceContext; +@class SentryEnvelopeItemHeader; + +NS_ASSUME_NONNULL_BEGIN + +@interface SentryPublicSerializer: NSObject + ++ (NSDictionary *)serializeUser:(SentryUser *)user; + ++ (NSDictionary *)serializeTraceContext:(SentryTraceContext *)traceContext; + ++ (NSDictionary *)serializeEnvelopeHeader:(SentryEnvelopeItemHeader *)header; + ++ (NSDictionary *)serializeEvent:(SentryEvent *)event; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sources/Sentry/include/SentrySpan.h b/Sources/Sentry/include/SentrySpan.h index b15dbe69428..95495d46cfc 100644 --- a/Sources/Sentry/include/SentrySpan.h +++ b/Sources/Sentry/include/SentrySpan.h @@ -1,6 +1,6 @@ #import "SentryDefines.h" #import "SentryProfilingConditionals.h" -#import "SentrySerializable.h" +#import "SentryInternalSerializable.h" #import "SentrySpanProtocol.h" NS_ASSUME_NONNULL_BEGIN @@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN @class SentryFramesTracker; #endif // SENTRY_HAS_UIKIT -@interface SentrySpan : NSObject +@interface SentrySpan : NSObject SENTRY_NO_INIT /** diff --git a/Sources/Sentry/include/SentryTransaction.h b/Sources/Sentry/include/SentryTransaction.h index 77a12e3b008..381de61139c 100644 --- a/Sources/Sentry/include/SentryTransaction.h +++ b/Sources/Sentry/include/SentryTransaction.h @@ -16,6 +16,8 @@ SENTRY_NO_INIT - (instancetype)initWithTrace:(SentryTracer *)trace children:(NSArray> *)children; +- (NSDictionary *)serialize; + @end NS_ASSUME_NONNULL_END diff --git a/Sources/Sentry/include/SentryUser+Serialize.h b/Sources/Sentry/include/SentryUser+Serialize.h deleted file mode 100644 index 0d5aa94a921..00000000000 --- a/Sources/Sentry/include/SentryUser+Serialize.h +++ /dev/null @@ -1,8 +0,0 @@ -#if SDK_V9 -# import "SentrySerializable.h" -# import "SentryUser.h" - -@interface SentryUser () - -@end -#endif // SDK_V9 diff --git a/Sources/Swift/Helper/SentrySdkInfo.swift b/Sources/Swift/Helper/SentrySdkInfo.swift index d2c529f1371..fd76cf7d1ae 100644 --- a/Sources/Swift/Helper/SentrySdkInfo.swift +++ b/Sources/Swift/Helper/SentrySdkInfo.swift @@ -6,7 +6,7 @@ import Foundation * @note Both name and version are required. * @see https://develop.sentry.dev/sdk/event-payloads/sdk/ */ -@_spi(Private) @objc public final class SentrySdkInfo: NSObject, SentrySerializable { +@_spi(Private) @objc public final class SentrySdkInfo: NSObject { @objc public static func global() -> Self { Self(withOptions: SentrySDKInternal.currentHub().getClient()?.options) diff --git a/Sources/Swift/Helper/SentrySerializationSwift.swift b/Sources/Swift/Helper/SentrySerializationSwift.swift index 0d044a60396..3d265308fc9 100644 --- a/Sources/Swift/Helper/SentrySerializationSwift.swift +++ b/Sources/Swift/Helper/SentrySerializationSwift.swift @@ -58,7 +58,7 @@ } if let traceContext = envelope.header.traceContext { - serializedData["trace"] = traceContext.serialize() + serializedData["trace"] = SentryPublicSerializer.serializeTraceContext(traceContext) } if let sentAt = envelope.header.sentAt { @@ -72,7 +72,7 @@ let newLineData = Data("\n".utf8) for i in 0.. [String: Any] } @objcMembers diff --git a/Sources/Swift/Integrations/SessionReplay/SentryReplayEvent.swift b/Sources/Swift/Integrations/SessionReplay/SentryReplayEvent.swift index eb4893860bd..7ce00d22469 100644 --- a/Sources/Swift/Integrations/SessionReplay/SentryReplayEvent.swift +++ b/Sources/Swift/Integrations/SessionReplay/SentryReplayEvent.swift @@ -32,12 +32,12 @@ import Foundation self.type = "replay_video" } - required convenience init() { + required convenience override init() { fatalError("init() has not been implemented") } - @_implementationOnly public override func serialize() -> [String: Any] { - var result = super.serialize() + public func serialize() -> [String: Any] { + var result = SentryPublicSerializer.serializeEvent(self) result["urls"] = urls result["replay_start_timestamp"] = replayStartTimestamp.timeIntervalSince1970 result["replay_id"] = SentryEventSwiftHelper.getEventIdString(self) diff --git a/Sources/Swift/Integrations/UserFeedback/SentryFeedback.swift b/Sources/Swift/Integrations/UserFeedback/SentryFeedback.swift index 01951d3988b..170287b5445 100644 --- a/Sources/Swift/Integrations/UserFeedback/SentryFeedback.swift +++ b/Sources/Swift/Integrations/UserFeedback/SentryFeedback.swift @@ -42,20 +42,11 @@ public final class SentryFeedback: NSObject { } } -#if !SDK_V9 -extension SentryFeedback: SentrySerializable { } -#endif - extension SentryFeedback { - #if SDK_V9 + @_spi(Private) public func serialize() -> [String: Any] { return internalSerialize() } - #else - public func serialize() -> [String: Any] { - return internalSerialize() - } - #endif private func internalSerialize() -> [String: Any] { let numberOfOptionalItems = (name == nil ? 0 : 1) + (email == nil ? 0 : 1) + (associatedEventId == nil ? 0 : 1) diff --git a/Sources/Swift/Persistence/SentryScopePersistentStore+User.swift b/Sources/Swift/Persistence/SentryScopePersistentStore+User.swift index 0dd54f6a7a7..05be8b64ebc 100644 --- a/Sources/Swift/Persistence/SentryScopePersistentStore+User.swift +++ b/Sources/Swift/Persistence/SentryScopePersistentStore+User.swift @@ -2,7 +2,7 @@ extension SentryScopePersistentStore { func encode(user: User) -> Data? { - guard let data = SentrySerializationSwift.data(withJSONObject: user.serialize()) else { + guard let data = SentrySerializationSwift.data(withJSONObject: SentryPublicSerializer.serializeUser(user)) else { SentrySDKLog.error("Failed to serialize user, reason: user is not valid json: \(user)") return nil } diff --git a/Sources/Swift/SentryAppState.swift b/Sources/Swift/SentryAppState.swift index 2ed5bb894da..e5e20fd46d6 100644 --- a/Sources/Swift/SentryAppState.swift +++ b/Sources/Swift/SentryAppState.swift @@ -1,7 +1,7 @@ @_implementationOnly import _SentryPrivate import Foundation -@objcMembers @_spi(Private) public class SentryAppState: NSObject, SentrySerializable { +@objcMembers @_spi(Private) public class SentryAppState: NSObject { public private(set) var releaseName: String? public private(set) var osVersion: String diff --git a/Sources/Swift/Tools/SentryClientReport.swift b/Sources/Swift/Tools/SentryClientReport.swift index 8c98cf83482..19fd6ba9c00 100644 --- a/Sources/Swift/Tools/SentryClientReport.swift +++ b/Sources/Swift/Tools/SentryClientReport.swift @@ -1,5 +1,5 @@ @objc -@_spi(Private) public final class SentryClientReport: NSObject, SentrySerializable { +@_spi(Private) public final class SentryClientReport: NSObject { @objc(initWithDiscardedEvents:dateProvider:) public init(discardedEvents: [SentryDiscardedEvent], dateProvider: SentryCurrentDateProvider) { diff --git a/Sources/Swift/Tools/SentryDiscardedEvent.swift b/Sources/Swift/Tools/SentryDiscardedEvent.swift index 09504c731b2..2c7226f6c5f 100644 --- a/Sources/Swift/Tools/SentryDiscardedEvent.swift +++ b/Sources/Swift/Tools/SentryDiscardedEvent.swift @@ -2,7 +2,7 @@ import Foundation @objcMembers @_spi(Private) -public final class SentryDiscardedEvent: NSObject, SentrySerializable { +public final class SentryDiscardedEvent: NSObject { let reason: String let category: String diff --git a/Sources/Swift/Tools/SentryEnvelopeItem.swift b/Sources/Swift/Tools/SentryEnvelopeItem.swift index de6146712b3..7470bdb1a32 100644 --- a/Sources/Swift/Tools/SentryEnvelopeItem.swift +++ b/Sources/Swift/Tools/SentryEnvelopeItem.swift @@ -28,7 +28,7 @@ * Initializes an envelope item with an event. */ @objc public convenience init(event: Event) { - var json = SentrySerializationSwift.data(withJSONObject: event.serialize()) + var json = SentrySerializationSwift.data(withJSONObject: SentryPublicSerializer.serializeEvent(event)) if json == nil { // We don't know what caused the serialization to fail. let errorEvent = Event() @@ -45,7 +45,7 @@ // We accept the risk that this simple serialization fails. Therefore we ignore the // error on purpose. - json = SentrySerializationSwift.data(withJSONObject: errorEvent.serialize()) + json = SentrySerializationSwift.data(withJSONObject: SentryPublicSerializer.serializeEvent(errorEvent)) } // event.type can be nil and the server infers error if there's a stack trace, otherwise diff --git a/Tests/SentryTests/TestUtils/SentryBooleanSerialization.h b/Tests/SentryTests/TestUtils/SentryBooleanSerialization.h index a4f8c17fa93..c7ad5fc17e5 100644 --- a/Tests/SentryTests/TestUtils/SentryBooleanSerialization.h +++ b/Tests/SentryTests/TestUtils/SentryBooleanSerialization.h @@ -1,14 +1,14 @@ #import -@protocol SentrySerializable; +@protocol SentryInternalSerializable; NS_ASSUME_NONNULL_BEGIN @interface SentryBooleanSerialization : NSObject -+ (void)testBooleanSerialization:(id)serializable property:(NSString *)property; ++ (void)testBooleanSerialization:(id)serializable property:(NSString *)property; -+ (void)testBooleanSerialization:(id)serializable ++ (void)testBooleanSerialization:(id)serializable property:(NSString *)property serializedProperty:(NSString *)serializedProperty; diff --git a/Tests/SentryTests/TestUtils/SentryBooleanSerialization.m b/Tests/SentryTests/TestUtils/SentryBooleanSerialization.m index aa3e2f42183..c8cf88ddb2b 100644 --- a/Tests/SentryTests/TestUtils/SentryBooleanSerialization.m +++ b/Tests/SentryTests/TestUtils/SentryBooleanSerialization.m @@ -1,19 +1,19 @@ #import "SentryBooleanSerialization.h" -#import "SentrySerializable.h" +#import "SentryInternalSerializable.h" #import NS_ASSUME_NONNULL_BEGIN @implementation SentryBooleanSerialization -+ (void)testBooleanSerialization:(id)serializable property:(NSString *)property ++ (void)testBooleanSerialization:(id)serializable property:(NSString *)property { [SentryBooleanSerialization testBooleanSerialization:serializable property:property serializedProperty:property]; } -+ (void)testBooleanSerialization:(id)serializable ++ (void)testBooleanSerialization:(id)serializable property:(NSString *)property serializedProperty:(NSString *)serializedProperty {