diff --git a/DuckDuckGo/UnifiedFeedbackForm/MetadataCollectors/UnifiedMetadataCollector.swift b/DuckDuckGo/UnifiedFeedbackForm/MetadataCollectors/UnifiedMetadataCollector.swift index a720ac8bdc..d84c49d722 100644 --- a/DuckDuckGo/UnifiedFeedbackForm/MetadataCollectors/UnifiedMetadataCollector.swift +++ b/DuckDuckGo/UnifiedFeedbackForm/MetadataCollectors/UnifiedMetadataCollector.swift @@ -25,18 +25,17 @@ protocol UnifiedMetadataCollector { } protocol UnifiedFeedbackMetadata: Encodable { - func toBase64() -> String + func toString() -> String } extension UnifiedFeedbackMetadata { - func toBase64() -> String { + func toString() -> String { let encoder = JSONEncoder() - do { let encodedMetadata = try encoder.encode(self) - return encodedMetadata.base64EncodedString() + return String(data: encodedMetadata, encoding: .utf8) ?? "" } catch { - return "Failed to encode metadata to JSON, error message: \(error.localizedDescription)" + return "Failed to encode metadata to JSON string, error message: \(error.localizedDescription)" } } } diff --git a/DuckDuckGo/UnifiedFeedbackForm/UnifiedFeedbackSender.swift b/DuckDuckGo/UnifiedFeedbackForm/UnifiedFeedbackSender.swift index 79f86b8f68..556cb64c48 100644 --- a/DuckDuckGo/UnifiedFeedbackForm/UnifiedFeedbackSender.swift +++ b/DuckDuckGo/UnifiedFeedbackForm/UnifiedFeedbackSender.swift @@ -107,7 +107,7 @@ struct DefaultFeedbackSender: UnifiedFeedbackSender { category: Category.from(category), subcategory: Subcategory.from(subcategory), description: description, - metadata: metadata?.toBase64() ?? "")) + metadata: metadata?.toString() ?? "")) } func sendFormShowPixel() {