Home:ALL Converter>Airdrop custom document type to SwiftUI DocumentGroup app

Airdrop custom document type to SwiftUI DocumentGroup app

Ask Time:2022-09-25T15:43:48         Author:Guy Brooker

Json Formatter

I am trying to get a simple SwiftUI iOS custom document app work with Airdrop. The app successfully opens a document when opened from Files or a Mail attachment. However when sending a document of the custom type by Airdrop from my mac, when the app is selected from the Airdrop notification, the app launches but only displays the file browser and the file does not seem to be copied over. No DocumentGroup view is displayed.

If I select Files from the Airdrop menu I can save the file.

I tried this with Apples sample code for DocumentBased apps, and it exhibits exactly the same behavior on my iPhone (iOS 16.0.2). Either this is a bug, or there is some extra secret sauce needed to get a SwiftUI Document app to receive files by Airdrop.

My custom type conforms to public.content, which I understand is required for Airdrop support.

Has anyone managed to get Airdrop reception working with a SwiftUI document app ?

Author:Guy Brooker,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/73842806/airdrop-custom-document-type-to-swiftui-documentgroup-app
yy