How can I share a transparent PNG to iMessage from the Share Sheet?

21 views Asked by At

When I try to share a transparent PNG via the Share Sheet and choose "AirDrop" or "Save Image" the saved image is transparent, however when I choose iMessage the image suddenly gains a white background. How can I avoid this?

import SwiftUI

struct ContentView: View {
    var body: some View {
        ZStack {
            let image = Image("santa")
            
            ShareLink(item: image,
                      preview: SharePreview("test", image: image)) {
                HStack {
                    Spacer()
                    Label("Share", systemImage: "square.and.arrow.up")
                    Spacer()
                }
            }
        }
    }
}

#Preview {
    ContentView()
}
0

There are 0 answers