diff --git a/CHANGELOG.md b/CHANGELOG.md index 16319e95bd0..fdb11a12aeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,10 @@ - Add a new prebuilt framework with ARM64e for WithoutUIKitOrAppKit (#5897) - Add source context and vars fields to SentryFrame (#5853) +### Fixes + +- Fixed a build error in `SentryFeedback.swift` when building with cocoapods on Xcode 14.2 (#5917) + ## 8.54.1-alpha.1 - No documented changes. diff --git a/Sources/Swift/Integrations/UserFeedback/SentryFeedback.swift b/Sources/Swift/Integrations/UserFeedback/SentryFeedback.swift index e34b763c6e8..c22eb600c02 100644 --- a/Sources/Swift/Integrations/UserFeedback/SentryFeedback.swift +++ b/Sources/Swift/Integrations/UserFeedback/SentryFeedback.swift @@ -48,9 +48,16 @@ extension SentryFeedback: SentrySerializable { } extension SentryFeedback { #if SDK_V9 - @_spi(Private) - #endif + @_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) var dict = [String: Any](minimumCapacity: 2 + numberOfOptionalItems) dict["message"] = message