Question or problem in the Swift programming language:
I’m am trying to implement a Document provider extension for my app in order to allow imports / exports / moves of files between apps.
I’ve created my main app and added both the document provider and the file provider extensions to the project, checking that they all form part of the same App Group Identifier in each of the target’s Capabilities.
The info plist for the document provider target has the following settings:
NSExtensionAttributes UIDocumentPickerModes UIDocumentPickerModeImport UIDocumentPickerModeExportToService UIDocumentPickerModeMoveToService UIDocumentPickerSupportedFileTypes public.content NSExtensionMainStoryboard Main NSExtensionPointIdentifier com.apple.fileprovider-ui
Whilst the info.plist for the file provider has the following:
NSExtensionFileProviderDocumentGroup group.com.myAppGroupId NSExtensionPointIdentifier com.apple.fileprovider-nonui NSExtensionPrincipalClass $(PRODUCT_MODULE_NAME).FileProvider
I am using the default implementations for both the UIDocumentPickerExtensionViewController subclass and the NSFileProviderExtension subclass that come generated when I create the targets, and I have put breakpoints in every method to test that they run appropriately.
But when I try and run the Document Provider, I can’t get my app to show in the list of apps available for sharing the document. I have tested this with both my device and the simulator, selecting both iPhoto and Pages as host apps.
Am I missing something here?
How to solve the problem:
Please make sure your app group contianer is same as that of the one written for your file provider’s info.plist
This was happened to me, but when i change it to the proper app group name above, the picker started working.