0

I want to implement a log exporter to export user logs from pages like Settings or Mail. In UIKit, UIActivityViewController would work well, but I’m looking for a more modern approach using SwiftUI.

I tried using Transferable with ShareLink:

struct ScreenshotFeedbackExporter: Transferable { var screenshots: [UIImage] = [] static var transferRepresentation: some TransferRepresentation { FileRepresentation(exportedContentType: .zip) { exporter in let url = try exporter.fileURL() return SentTransferredFile(url) } .suggestedFileName("feedback.zip") } func fileURL() throws -> URL { try FeedbackManager.shared.constructShareFile(screenshots: screenshots) } } 

However, when sharing the file on platforms like Telegram, it doesn’t open correctly.

2
  • What do you mean by "it doesn’t open correctly"? What error message did you get? What exactly happened? Commented Oct 22, 2024 at 8:22
  • @Sweeper I shared that file to Telegram, and it showed "file" as filename, and it has just 5KB. I promise constructShareFile(screenshots:) returns a real url and includes real hundreds KB zip file which is not just named "file" Commented Oct 22, 2024 at 8:56

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.